How to get a list of Domain Admin users from a windows 2003 DC

20,927

Try this:

dsget group <group DN> -members -expand > Group_Members.txt

The created document now contains the DN of each member of the group. You can then use this to get more details for each user

dsget user <user DN>
Share:
20,927

Related videos on Youtube

DSKyo
Author by

DSKyo

Updated on September 18, 2022

Comments

  • DSKyo
    DSKyo over 1 year

    I'm trying to get a list of domain admin users from my Windows Server 2003 domain controller. I am unable to obtain it with powershell because the ActiveDirectory module is not installed.

    I need to obtain it from CMD.

    I have tried net group /domain "Domain Admins" and while this returns all the Domain Admin users I need the following format which I don't know how to obtain. Any ideas?

    The list should contain:

    User name (Baker, John for example)
    sAMAccountName (`I can obtain this with net /group`)
    Account creation date
    Last logon date
    If the account is enabled or not
    

    EDIT: I have tried dsquery group -name "Domain Admins" | dsget group -members -expand but I don't get the expected output either.

    • Massimo
      Massimo over 2 years
      I’m voting to close this question because it's so obsolete it makes me cry.
  • DSKyo
    DSKyo over 7 years
    I have tried dsget group "Domain Admins" -members -expand but got the following error: dsget failed:Value for 'Target object for this command' has incorrect format.. Am I not using it right?
  • Ben Lavender
    Ben Lavender over 7 years
    You need to use the DistinguishedName attribute.
  • DSKyo
    DSKyo over 7 years
    Thanks, this worked, however I only got the domain admin user names and the OU they belong to, any idea how I can get the rest of the details i need? Account creation, when was the account created, and whether it is enabled or not?