简体   繁体   English

获取共享中所有文件夹的ACL

[英]Get ACL of all folders in shares

Have script that pulls the ACL of all of the folders in network shares on my my server (minus admin shares). 有脚本可以提取我服务器上网络共享中所有文件夹的ACL(减去管理共享)。 Seems to work but the output is giving me some numbers rather than the permissions and I don't understand what the number means and better yet how do I translate them to regular permissions (FC, RO, etc.) 似乎可以正常工作,但输出显示的是数字而不是权限,但我不明白数字的含义,更好的是如何将其转换为常规权限(FC,RO等)

$shares = Get-SmbShare | Where-Object Name -notlike "*$" | Select-Object Name

$Report = @()
foreach ($share in $shares){
   $path = "\\$env:COMPUTERNAME\" + $share.Name.ToString()
   $FolderPath = dir -Directory -Path $path -Recurse -Force
   Foreach ($Folder in $FolderPath) {
      $Acl = Get-Acl -Path $Folder.FullName
      foreach ($Access in $acl.Access)
      {
         $Properties = [ordered]@{
            'FolderName'=$Folder.FullName;
            'ADGroup or User'=$Access.IdentityReference;
            'Permissions'=$Access.FileSystemRights;
            'Inherited'=$Access.IsInherited}
         $Report += New-Object -TypeName PSObject -Property $Properties
      }
   }
}
$Report | Export-Csv -path "C:\temp\FolderPermissions.csv"

Here is some of the output that I get (trimmed a bit to keep it short) 这是我得到的一些输出(将其简短一些以使其简短)

"FolderName","ADGroup or User","Permissions","Inherited"
"\\WIN-RPK9O6GR3JM\foobar\STE","NT AUTHORITY\SYSTEM","FullControl","True"
...
"\\WIN-RPK9O6GR3JM\foobar\STE","CREATOR OWNER","268435456","True"
"\\WIN-RPK9O6GR3JM\foobar\STE\LOG","BUILTIN\Users","CreateFiles","True"
"\\WIN-RPK9O6GR3JM\foobar\STE\LOG","CREATOR OWNER","268435456","True"
...
"\\WIN-RPK9O6GR3JM\foobar\STE\TMP","BUILTIN\Users","CreateFiles","True"
"\\WIN-RPK9O6GR3JM\foobar\STE\TMP","CREATOR OWNER","268435456","True"
...
"\\WIN-RPK9O6GR3JM\SYSVOL\foobar.net","NT AUTHORITY\Authenticated Users","-1610612736","True"
...
"\\WIN-RPK9O6GR3JM\SYSVOL\foobar.net","BUILTIN\Administrators","-536084480","True"

If anyone can explain or point me in the right direction on what these values are and how I translate them I would be most grateful. 如果有人能向我解释或指出这些价值观是什么以及如何翻译它们,我将不胜感激。

TIA! TIA!

This is so far I have gotten to help you out: 到目前为止,我已经帮助您了:

268435456 - FullControl

-536805376 - Modify, Synchronize

-1610612736 - ReadAndExecute, Synchronize

But go through the links to relate all of them : 但是,请通过链接将它们关联起来:

Link 1 链接1

Link 2 连结2

Link 3 连结3

Hope it helps you. 希望对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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