Get user's non-truncated Active Directory groups from command line

前端 未结 7 585
南旧
南旧 2021-01-30 00:46

I often use the net user command to have a look at AD groups for a user:

net user /DOMAIN 

This works well, howeve

相关标签:
7条回答
  • 2021-01-30 01:25

    Much easier way in PowerShell:

    Get-ADPrincipalGroupMembership <username>

    Requirement: the account you yourself are running under must be a member of the same domain as the target user, unless you specify -Credential and -Server (untested).

    In addition, you must have the Active Directory Powershell module installed, which as @dave-lucre says in a comment to another answer, is not always an option.

    For group names only, try one of these:

    (Get-ADPrincipalGroupMembership <username>).Name
    Get-ADPrincipalGroupMembership <username> |Select Name
    
    0 讨论(0)
提交回复
热议问题