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>
Related videos on Youtube
Author by
DSKyo
Updated on September 18, 2022Comments
-
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 over 2 yearsI’m voting to close this question because it's so obsolete it makes me cry.
-
-
DSKyo over 7 yearsI 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 over 7 yearsYou need to use the DistinguishedName attribute.
-
DSKyo over 7 yearsThanks, 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?