Tuesday 10 September 2013

Get User in Active Directory geek way

In Windows Active Directory there are many ways to manage the data. The easiest way is use the Gui console provided by Microsoft and had been a friend to many of Windows Administrator.

But how if we need to get many of the user in single command ? Here are the command line still the most favorite choice of smart and Lazy administrator.

Here are some command to interact with Active Directory using Dsquery command. Just drop to MSDos box and query it.

To get all Group in Active Directory :

dsquery group -limit 10000 > groups.csv

To get all Users in Active Directory :

dsquery user -limit 10000 > users.csv

To get Users which  not logon in last 4 weeks :

dsquery user -inactive 4

To get all Members of a Group :

dsget group "CN=Fin,DC=asu,DC=com" -members

To get a user details in Active directory :

dsquery user -name Admin

I will post more of the usage and updated in this articles. Stay Tuned :)

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More