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

前端 未结 7 718
南旧
南旧 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:17

    Or you could use dsquery and dsget:

    dsquery user domainroot -name  | dsget user -memberof
    

    To retrieve group memberships something like this:

    Tue 09/10/2013 13:17:41.65
    C:\
    >dsquery user domainroot -name jqpublic | dsget user -memberof
    "CN=Technical Support Staff,OU=Acme,OU=Applications,DC=YourCompany,DC=com"
    "CN=Technical Support Staff,OU=Contosa,OU=Applications,DC=YourCompany,DC=com"
    "CN=Regional Administrators,OU=Workstation,DC=YourCompany,DC=com"
    

    Although I can't find any evidence that I ever installed this package on my computer, you might need to install the Remote Server Administration Tools for Windows 7.

提交回复
热议问题