와 UNC 경로에-ACL을 가져 PowerShell을.내가 <code>Get-Acl</code> cmdlet을 통해 UNC 경로에 대한 ACL을 확인하려고 공간
다음은 공백없이 로컬 파일 시스템이나 UNC 경로를 탐색 할 때 잘 작동합니다. 공백
UNC 경로에$ou = 'OU=Security Groups,DC=mydomain,DC=local'
$basepath = '\\mydomain\dfsroot'
$filter = '*501*'
Get-ADGroup -SearchBase $ou -Filter { Name -like $filter } | % {
$principle = $_.samAccountName
Get-ChildItem -LiteralPath $basepath -Recurse | % {
$path = $_.FullName
($path | Get-Acl).Access.IdentityReference | % { if ($_.Value -match $principle) { Write-Host "$principle has rights to $path" }}
}
}
은 내가 "FileNotFoundException이"를 얻을 :
Get-Acl : \local501\dfsroot\docs\Accounting\Bankruptcy Files\NOTICE TO MEMBERSHIP RE-CHAPTER 11.pdf
At C:\Users\administrator.LOCAL501\Documents\IT Support Guys - (855) 4 IT GUYS\Files\find_paths_by_principle.ps1:11 char:18
+ ($path | Get-Acl).Access.IdentityReference | % { if ($_.Valu ...
+ ~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-Acl],FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.GetAclCommand
누군가 나를 여기에 무슨 일이 일어나고 있는지 이해하는 데 도움이 수 있습니까?
감사합니다.
그 명령은 다음과 같습니다. Get-ChildItem : '\\ mydomain \ dfsroot \ demo \ path'경로의 일부를 찾을 수 없습니다. 줄에 : 1 문자 : 1 + -recurse '\\에 mydomain \의 dfsroot'- ChildItem을 얻기 + ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ReadError : (\\에 mydomain \ DFSR ... 모 \ 경로 : 문자열)은 Get-ChildItem을, DirectoryNotFoundException + FullyQualifiedErrorId : DirIOError, Microsoft.PowerShell.Commands.GetChildItemCommand –
@ChristianGerlach'\\ mydomain \ dfsroot \ demo \ path'에 공백이 있습니까? 너무 일찍 실행하는 것은 매우 이상한 오류입니다. – TheIncorrigible1
예. 나는 그것이 이상하다 동의합니다. –