A simple command to get a list of inactive users and computers in Active Directory .
It's quick and easy to get the list of inactive users and computers, but you need to run this on the server.
This command below will list all inactive users which has been inactive for about 30 days or more.
dsquery user -inactive 30
This command below will list all inactive computers which has been inactive for about 30 days or more.
dsquery computer -inactive 30
Replace the number "30" for any number of days.
It's a good practice to disable accounts not in use to reduce the footprint of security risk.
If you are 100% sure that the account will not be needed anymore, better remove the account
from Active Directory rather than disabling it.
Or if you love history or not sure about deleting the account, then just disable it.
The command can be tweak and run on PowerShell if you need to do it remotely.
Any tips about quick and easy way, in managing active directory in mind? Please drop it on the comment below..
Cheers..Hope it helps..