[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 836
  • Last Modified:

export/list all user's SAMIDs

How do I export all the user's samid in the USERS container into a text file?

Thanks.
0
nav2567
Asked:
nav2567
3 Solutions
 
benhansonCommented:
You can do it from the command line using dsquery:

dsquery * -filter "(&(objectCategory=user))" "OU=Users,DC=domain,DC=com" -limit 0 -attr samAccountName >> UsersBySamAccountName.txt
0
 
bsharathCommented:
I like using a great tool called adfind by Joe Richards

http://www.joeware.net/freetools/tools/adfind/index.htm</P>

adfind -default -bit -f  "&(objectcategory=person)(objectclass=user)(!userAccountControl:AND:=2)" samaccountname displayname -csv > c:\EnabledUsers.csv

That will give you a csv file on your C drive with all enabled users.

From Ee
0
 
nav2567Author Commented:
Thanks everyone for helping
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now