无法列出企业管理员的所有成员

时间:2018-03-08 05:51:59

标签: powershell active-directory ldap

我相信我会发疯但也许我错过了什么。我试图枚举企业管理员的所有成员。当我查看DSA.MSC GUI工具时,我看到没有嵌套的类似内容:

John
Bill
Jim
Sue
Mary
Spiderman

当我执行LDP.EXE,PowerShell或ADSIEDIT查询时,我只看到这个:

John
Bill
Sue
Mary

以下是我尝试计算此差异的一些方法:

  • 查看ADSIEDIT中的Enterprise Admins并查看成员属性。不列出蜘蛛侠
  • 查看LDP.EXE中的Enterprise Admins并查看成员属性。不列出蜘蛛侠

执行以下PowerShell查询

Get-ADgroup 'enterprise admins' -properties members | 
    select -Expandproperties members
# No Spiderman listed

Get-ADuser spiderman -properties memberof | 
    select -Expandproperties memberof
# No Enterprise Admins listed

Get-ADObject (Get-ADuser spiderman) -properties memberof | 
    select -Expandproperties memberof
# No Enterprise Admins listed

Get-AdObject (Get-ADgroup 'enterprise admins') -properties member | 
    select -Expandproperties members
# No Spiderman listed

Get-ADGroupMembers 'Enterprise Admins'
# **Spiderman listed!!!!!!**

我在这里缺少什么!为什么蜘蛛侠在ADUC / Get-AdGroupMembers中列出而在其他地方没有。我疯了吗?

2 个答案:

答案 0 :(得分:1)

在Windows中,primaryGroupID表示posix subsystem使用了帐户的主要群组。

通常如Bill_Stewart所述,永远不会有理由更改primaryGroupID属性。 (自Windows Server 2003起)

primaryGroupID属性: The user is a member of its primary group, although the group is not listed in the user's memberOf attribute. Likewise, a group object's member attribute will not list the user objects whose primaryGroupID is set to the group.

答案 1 :(得分:0)

显然,如果我将主要组ID切换到企业管理员,它会从传统查询中隐藏它。一旦我将其切换回域用户,我就可以撤回查询。

我想知道为什么会这样做。

相关问题