Windows 如何在powershell中使用AdiseArcher查询安全策略?

Windows 如何在powershell中使用AdiseArcher查询安全策略?,windows,powershell,active-directory,sysadmin,penetration-testing,Windows,Powershell,Active Directory,Sysadmin,Penetration Testing,我正在尝试查找所有设置TrustedForElegation的服务器:如果是,我可以使用[adsisearcher]ObjectCategory=Computer.Findall.properties查找所有服务器,但我看不到任何安全策略属性。如何查看安全策略属性的筛选 顺便说一句,我使用AdiseArcher的原因是我没有可用于导入的Active Directory模块。受信任的委派权限存储在AD中的userAccountControl属性中,该属性为a,这意味着该值指示可以打开或关闭的几个标

我正在尝试查找所有设置TrustedForElegation的服务器:如果是,我可以使用[adsisearcher]ObjectCategory=Computer.Findall.properties查找所有服务器,但我看不到任何安全策略属性。如何查看安全策略属性的筛选


顺便说一句,我使用AdiseArcher的原因是我没有可用于导入的Active Directory模块。

受信任的委派权限存储在AD中的userAccountControl属性中,该属性为a,这意味着该值指示可以打开或关闭的几个标志。完整的列表是

将其添加到查询中有点棘手。它需要进行比较,以查看是否启用了特定标志。AD允许通过一个称为LDAP_匹配_规则_位_和

您可以在如下LDAP查询中使用它:

(userAccountControl:1.2.840.113556.1.4.803:=524288)
([adsisearcher]"(&(objectCategory=computer)(userAccountControl:1.2.840.113556.1.4.803:=524288))").Findall()
因此,查找具有受信任的委派权限的所有计算机的代码如下所示:

(userAccountControl:1.2.840.113556.1.4.803:=524288)
([adsisearcher]"(&(objectCategory=computer)(userAccountControl:1.2.840.113556.1.4.803:=524288))").Findall()