【发布时间】:2021-11-22 17:37:03
【问题描述】:
- PS 版本:PowerShell 7+
- 操作系统版本:Windows Server 2016
目标:我想使用 PowerShell 来获取 AD 架构对象的权限,而不需要 Active Directory PsDrive / PsProvider。
根据我的测试,AD 模块附带的 Active Directory PsProvider 不适用于 Windows Server 2016 上的 PowerShell 7+。 This MS documentation 也提到了这一点。因为创建/使用 Active Directory PsDrive 需要 PsProvider,所以您无法访问像 AD:\ 这样的 AD 对象。使用这种方法通常是我喜欢的。下面是我所需要的一个示例,除了我使用的是 Windows PowerShell 而不是 PowerShell 7+。
这将获取配置架构权限:
(Get-Acl "AD:$((Get-ADRootDSE).schemaNamingContext)").Access
该对象的可分辨名称示例:
CN=Schema,CN=Configuration,DC=my,DC=domain,DC=com
鉴于上述限制,我可以使用 PowerShell 7+ 中的哪些其他选项来访问这些权限?
【问题讨论】:
标签: powershell active-directory