Search This Blog

How would you find all users that have not logged on since last month?

You can use DSQuery user command for this purpose. DS commands are used to retrieve information from Active Directory through command line. To use DSQuery, you must run the DSQuery command from an elevated command prompt. To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator.

C:\>dsquery user -inactive 4

"CN=Service User,OU=IT,DC=nishantsoft,DC=com"

"CN=IT JOURNAL,OU=Management,OU=Gurgaon,DC= nishantsoft,DC= com "

"CN=Dipak Khanna,OU=RC,OU=Gurgaon,DC= nishantsoft,DC= com "

"CN=Amit Mishra,OU=RC,OU=Gurgaon,DC= nishantsoft,DC= com "

"CN=Test Account,OU=Development,OU=Gurgaon,DC= nishantsoft,DC= com "

"CN=Jeevan Singh,OU=Development,OU=Gurgaon,DC= nishantsoft,DC= com "