Home > SCRIPTING, WINDOWS > How would you find all users that have not logged on since last month?

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

  • Sharebar

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=rahultweaks,DC=com”

“CN=IT JOURNAL,OU=IT Dept,OU=Trivandrum,DC= rahultweaks,DC= com ”

“CN=Rahul ,OU=IT Dept,OU=Trivandrum,DC= rahultweaks,DC= com ”

“CN=Akhil,OU=IT,OU=Chennai,DC= rahultweaks,DC= com ”

“CN=Test Account,OU=Development,OU=Canada,DC= rahultweaks,DC= com ”

“CN=Jestin Chandrabose,OU=IT Dept,OU=Trivandrum,DC= rahultweaks,DC= com ”

also export to text file

dsquery user -inactive 4 > c:\report.txt

Categories: SCRIPTING, WINDOWS Tags:
  1. No comments yet.
  1. No trackbacks yet.

Uses wordpress plugins developed by www.wpdevelop.com Copy Protected by Chetans WP-Copyprotect.