Convert Novell trustee_database.xml to CSV

With this powershell you can convert the Trustee XML of the Microfocus Novell Enterprise Server into a readable form. The depth of the explicit permissions is given in the first column.

We would like to point out, if you are about to transfer your Microfocus / Novell filer to the Microsoft world, that some special features of the Windows world must be taken into account.

The Novell Microfocus file system has a decisive advantage over the Windows system. Only the rights on the authorization endpoint had to be taken care of. The file system independently ensured that the user could browse to this directory based on the least privilege principle. This is much more cumbersome under Microsoft. If you want to set clean rights, then explicit rights for the listing must be built all the way to the authorization end point. This creates a multitude of new necessary groups and can quickly become a problem.

Therefore, the token count and the token size value for the Kerberos login under Windows are strongly affected.

We therefore recommend

  1. Before you migrate, look for obsolete data. These probably no longer need to be adopted. Perhaps they can be deleted or separated for emergencies.
  2. to take into account the age of the data in the migration
    You no longer need explicit permissions on directories that only contain old data. Put a tool like that migRaven to analyze the permissions and age and then decide.
    https://www.migraven.com/loesungen/analyse-daten/
  3. Now you can rethink the structure. It is worth questioning the old, grown structures. They can probably be built flat. You will thank your colleagues above all if you have to travel shorter distances to the data. That saves time.

If you need support during the migration, we are happy to assist you. It is our daily bread. We support migration projects around the world.

<#
Search for all .xml files in folder 
convert the files in CSV format
#>

$strParentPath = Split-Path -parent $MyInvocation.MyCommand.Definition

foreach($file in Get-ChildItem $strParentPath  | Where { $_.Extension -eq ".xml"})
{
    
    


    
    $strOutputPath = [string]::Concat($strParentPath, "\" + $file.BaseName + ".csv")
    Out-file $strOutputPath -Encoding utf8 -Force 
    write "Tiefe;Pfad;Recht;trustee;SAM" | Out-File $strOutputPath -Append utf8
    $strInputPath = [string]::Concat($strParentPath, "\" + $file.Name)
    $doc = [XML] (get-content -path $strInputPath )
    $paths = $doc.volume_trustees.trustee
    #$paths = $doc.volume_trustees.inherited_rights_mask 
    foreach ($path in $paths)
    {
        
        
        $strPattern = "\."
        $strPatternCN = "[\w]{1,}"
        $strName1 = $path.name.ToString()
  
        $arrResult = ([regex]::matches($strName1, $strPatternCN) | %{$_.value})
        $strPath = [string] $path.path.ToString()
        $strPath = $strPath -replace "/", "\"
        $arrFields = $strPath.split('\')
        $strCount = $arrFields.count -1
        $SAM = $strName1.Split(".")[1] 
       write-host $SAM
       
        $strRight = $path.rights.ToString()
        write "$strCount;$strPath;$strRight;$strName1;$SAM" | Out-File $strOutputPath -Append default  
    }
    $paths = $doc.volume_trustees.inherited_rights_mask 
# Filter auslesen in den Trustees
    foreach ($path in $paths)
    {
        
        
        $strPattern = "\."
        $strPatternCN = "[\w]{1,}"
        $strName1 = $path.name.ToString()
  
        $arrResult = ([regex]::matches($strName1, $strPatternCN) | %{$_.value})
        $strPath = [string] $path.path.ToString()
        $strPath = $strPath -replace "/", "\"
        $arrFields = $strPath.split('\')
        $strCount = $arrFields.count -1
        $SAM = $strName1.Split(".")[1] 
       write-host $strRight
       
        $strRight = $path.rights.ToString()
        write "$strCount;$strPath;-$strRight;$strName1;$SAM" | Out-File $strOutputPath -Append default  
    }

}   

Permanent link to this post: https://help.migraven.com/novell-trustee-database-xml-in-csv-konvertieren-migration-vorbereiten/

Leave a Comment

Your email address will not be published.