- Abussi Technical Blog - http://managedsystemservices.co.uk -

How to find and remove inactive computer accounts from active-directory

Posted By Paul On 25/02/2009 @ 05:00 pm In Server Tips | No Comments

First the Adminpak for Windows Server must be installed - the latest can be found here:
http://www.microsoft.com/downloads/details.aspx?familyid=e487f885-f0c7-436a-a392-25793a25bad7&displaylang=en

Now check for computer that haven’t logged in in a period of time - the example below uses 8 weeks - from the command line enter:
dsquery computer -inactive 8 -limit 0

After reviewing this list to make sure these computers no longer exist on your network you can use the following command to find and delete them:
dsquery computer -inactive 8 -limit 0 | dsrm -noprompt


Article printed from Abussi Technical Blog: http://managedsystemservices.co.uk

URL to article: http://managedsystemservices.co.uk/2009/02/25/how-to-find-and-remove-inactive-computer-accounts-from-active-directory/

Click here to print.