简体   繁体   中英

Get-Acl on a Mapped Drive?

Is there a limitation to Get-Acl in that it doesn't work with mapped drives?

When I run it against C:\\Test , it works fine. When I run against a mapped drive I get:

Get-Acl : Method failed with unexpected error code 50.
At line:1 char:1
+ Get-Acl U:\Themes
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-Acl], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.GetAclCommand

The cmdlet Get-ACL can only operate on drives available to Powershell. Check your Powershell drives with this cmdlet:

Get-PSDrive

Add a network drive for Powershell like this:

New-PSDrive -Name "Z" -PSProvider FileSystem -Root \\server\share1

Now Retry:

Get-ACL Z:\

When I view the properties of the folder in Explorer, I don't see the security tab. I thought I could always see the security tab... guess not.

属性截图

尝试此操作以使安全性选项卡显示在属性下:+控制面板>文件夹选项>查看选项卡-取消选中“使用简单文件共享”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM