PowerShell 技能连载 - 查找递归的 AD 成员
在 AD 中,有一个看起来很奇怪的过滤器:1.2.840.113556.1.4.1941。它被称为“链式匹配规则”,可以用来快速查找嵌套的成员。
您所需的是某个成员的 DN。然后,您可以像这样使用它:
1 | #requires -Version 1 -Modules ActiveDirectory |
Since this is a native LDAP filter, you can even use it without the ActiveDirectory module, resorting to native .NET methods:
由于它是一个原生的 LDAP 过滤器,您甚至可以在没有 ActiveDirectory 模块的情况下以 .NET 原生的方式使用它。
1 | $DN = 'place DN here!' |