I am trying to audit the permissions on a file server as a domain administrator and am getting an error for 'unauthorized operation' on some uses. When I use D:\Share\IT, I am able to get the command to run; when I use \Prod I cannot.
I am using the following in PowerShell:
Get-ChildItem D:\Share\Prod -Directory -Recurse | Get-Acl | Select-Object path,accesstostring,owner| Export-Csv C:\Temp\file.csv
I am receiving the following error:
Get-Acl : Attempted to perform an unauthorized operation.
At line:1 char:51
+ Get-ChildItem D:\Share\Prod -Directory -Recurse | Get-Acl |Select-Object ...
+ CategoryInfo : NotSpecified: (:) [Get-Acl], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetAclCommand
I am logged in as a domain administrator, with PowerShell using Run As Administrator.