PS: Script to Save Share Permissions to a Text File

Specifications: It creates the log file afresh for every run Inserts two new lines after every folder ACLs output Uses Get-ACL Supports paths with spaces Script: $permsLogFile = "C:tempshare-permissions.txt" Write-Output "Start of the script" > $permsLogFile $networkPath = \<servername><sharename>" $subFolders = Get-ChildItem -Name $networkPath foreach ($Folder in $subFolders){ $cmd = ‘Get-Acl "’ + "$networkPath$Folder" + ‘"’ Write-Output "`r`n`r`nRunning Commamnd: $cmd" >> $permsLogFile Invoke-Expression $cmd | Write-Output >> $permsLogFile }   Output: Start of the script Running Commamnd: Get-Acl "\myserverusersFolder With Spaces" Directory: \myserverusers Path             Owner             Access            —-             —–             ——            Folder With Spaces          BUILTINAdministrators         NT AUTHORITYSYSTEM Allow FullControl…    Running Commamnd: Get-Acl […]

Read more