枚举 Windows 网络共享及其上或内部的所有自定义权限

发布于 2024-07-05 10:39:39 字数 491 浏览 8 评论 0原文

我们有各种服务器,其中有许多共享目录。 查看共享浏览器以查看“顶级”共享是什么很容易,但下面是一堆杂乱的自定义权限,没有任何记录。

我想枚举域上的所有共享(当然是所有“服务器”,本地 PC 就很好),然后递归每个共享并报告与父级的任何偏差。 如果孩子有相同的权限,则无需报告。

与编写大型 C# 应用程序相比,我更喜欢简单的脚本解决方案,但任何有效的方法都可以(甚至现有软件)。

例如,我想得到:

SERVER1\
 \-- C: (EVERYONE: Total control, ADMINs, etc. etc.)
   \-- (skip anything that is not the same as above)
   \-- SuperSecretStuff (Everyone: NO access; Bob: Read access)
SERVER2\ 
 \-- Stuff (some people)

等等。

We have various servers that have many directories shared. It's easy enough to look at the share browser to see what the "top level" shares are, but underneath is a jumbled mess of custom permissions, none of which is documented.

I'd like to enumerate all the shares on the domain (definitely all the 'servers', local PCs would be nice) and then recurse down each one and report any deviation from the parent. If the child has the same permissions, no need to report that back.

I'd prefer a simple script-y solution to writing a big C# app, but any method that works will do (even existing software).

For example, I'd like to get:

SERVER1\
 \-- C: (EVERYONE: Total control, ADMINs, etc. etc.)
   \-- (skip anything that is not the same as above)
   \-- SuperSecretStuff (Everyone: NO access; Bob: Read access)
SERVER2\ 
 \-- Stuff (some people)

etc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

久光 2024-07-12 10:39:39

我知道这不是脚本,但是你尝试过 ShareEnum 吗? http://technet.microsoft.com/en-us/sysinternals/bb897442。 aspx 然后导出出来? 您还可以与较早的运行进行比较。 我不认为有命令行界面(这很糟糕),但它会为您提供所需的信息

I know it isnt scripting, but have you tried ShareEnum? http://technet.microsoft.com/en-us/sysinternals/bb897442.aspx and then export it out? You can also compare to older runs. I don't think there is a cmd line interface (which sucks), but it will get you the info you need

梦开始←不甜 2024-07-12 10:39:39

此 Powershell 脚本可实现您的目标。

正如它所说:

这个小脚本将枚举计算机上的所有共享,并列出每个共享的共享级别权限。 它使用 WMI 检索共享并列出权限。

请注意,此脚本列出了共享级权限,而不是 NTFS 权限。

它接受多台计算机作为输入、单个 IP,或在本地系统中运行它:

       .EXAMPLE 
       C:\PS> .\Get-SharePermissions # Operates against local computer. 

       .EXAMPLE 
       C:\PS> 'computerName' | .\Get-SharePermissions 

       .EXAMPLE 
       C:\PS> Get-Content 'computerlist.txt' | .\Get-SharePermissions | Out-File 'SharePermissions.txt' 

This Powershell script accomplishes your goal.

As it is stated:

This little script will enumerate all the shares on a computer, and list the share-level permissions for each share. It uses WMI to retrieve the shares, and to list the permissions.

Note that this script lists share-level permissions, and not NTFS permissions.

It accepts a number of computers as its input, a single IP, or running it in the local system:

       .EXAMPLE 
       C:\PS> .\Get-SharePermissions # Operates against local computer. 

       .EXAMPLE 
       C:\PS> 'computerName' | .\Get-SharePermissions 

       .EXAMPLE 
       C:\PS> Get-Content 'computerlist.txt' | .\Get-SharePermissions | Out-File 'SharePermissions.txt' 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文