Authored by: Support.com Tech Pro Team
How to Manage Inactive User and Computer Accounts in Active Directory
Execute the following commands to search the dormant accounts in the Active Directory.
dsquery user -inactive 15
dsquery computer -inactive 15
After listing inactive accounts, you manage them by performing the below-given methods (you can choose any method from these):
Method 1 – Reset Passwords of Inactive Accounts
Perform the following steps just after listing the inactive accounts.
Method 2 – Disable the Inactive Accounts
The inactive accounts must be disabled within 15-60 days to prevent any further security threats, using the commands given below:
dsquery user -disabled -limit 30
dsquery computer -disabled -limit 30
Here, 30 days is the inactivity period and you can change it.
Method 3 – Move the account to an Organizational unit
After a few days of disabling the accounts, these should be moved to a stand-alone organizational unit. Right-click the username, select “Move†from the context menu and move the user to a standalone Organizational Unit. You can also drag and drop the user and computer account to any Organizational Unit.
Method 4 – Delete the inactive accounts
All the disabled inactive accounts after being moved to an organizational unit must be deleted to make sure that no one can use them at all. Execute the following commands.
dsquery user -inactive 50 | dsrm–noprompt
dsquery computer -inactive 7 | dsrm –noprompt
Here, 50 days is the inactivity period and you can change it