Unerwartetes token 'server' in Ausdruck oder Anweisung

$ServerList = Get-Content "C:\Users\munjanga\Desktop\Execute\Testing\servers.txt"
$ServerList

$Header="FolderPath,IdentityReference,AccessControlType,IsInherited,InheritedFlags,PropagationFlags"

Add-Content -Value $Header -Path $Output

Foreach ($Server in $ServerList) {
    $output = "\\C:\Users\munjanga\Desktop\Repositroy "$server.output.csv"
    Del $Output -ErrorAction SilentlyContinue

    $RootPath ="\\$Server\C:\system.sav"

    $Folders = dir $RootPath -recurse | where {$_.psiscontainer -eq $true} -ErrorAction SilentlyContinue

    Add-Content -Value "$Header" -Path $Output

    Foreach ($Folder in $Folders){

        $ACLs = get-acl $Folder.fullname | ForEach-Object { $_.Access }

        Foreach ($ACL in $ACLs){

            $OutInfo = $Folder.Fullname + "," + $ACL.IdentityReference + "," + $ACL.AccessControlType + "," + $ACL.IsInherited + "," + $ACL.InheritanceFlags + "," + $ACL.PropagationFlags

            Add-Content -Value $OutInfo -Path $output -ErrorAction SilentlyContinue
       }
    }
}
InformationsquelleAutor user3738022 | 2014-06-21
Schreibe einen Kommentar