列出 Windows 的 SMB 共享及其权限

用 Get-SmbShare 枚举本机所有共享文件夹,并用 Get-SmbShareAccess 审查其访问列表。

WindowsSMB 文件共享共享审计低风险
运行 Get-SmbShare 列出本机所有共享,再用 Get-SmbShareAccess -Name "Projects" 查看某个共享的访问权限。

01命令

命令
$ Get-SmbShare | Format-Table Name,Path,Description -AutoSize; Get-SmbShareAccess -Name "Projects"

02作用说明

net share 也能列出共享,但 Get-SmbShare 可直接进入管道,且与 Get-SmbShareAccess 搭配能区分共享 ACL 和 NTFS ACL——这两个层面人们总是混淆。它还会显示隐藏的管理共享(C$、ADMIN$),这些在 net share 输出里很容易被忽略。任何共享出现 Everyone:Full 都是最严重的审计发现。

03风险

风险低风险
使用条件Run PowerShell as Administrator to see all shares including default admin shares

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • Get-SmbShare | Microsoft Learn
    Microsoft · vendor-doc · 2026-09-17
    依据: Microsoft documents Get-SmbShare as retrieving SMB shares exposed by the server, and Get-SmbShareAccess as showing the access control entries of a share.

最后验证: 2026-09-17 · 分类: 安全与隐私