lundi 31 janvier 2011

PowerShell Find and Delete Old Computer Accounts - Clean Active Directory

PowerShell find all the inactive computer accounts in the domain.

You can do this by this simple line as long as you have the Quest AD Cmdlets installed.

get-qadcomputer -IncludeAllProperties | Where-Object { $_.lastlogon -lt (get-date).AddDays(-90) }

Quest AD Cmdlets are free to download from http://www.quest.com/powershell/activeroles-server.aspx

1 commentaire:

  1. Thanks for sharing useful PowerShell script which helps to find out inactive computer accounts in active direc tory environment. I tried this active directory cleanup tool (http://www.lepide.com/active-directory-cleaner/) which generates reports on inactive user accounts who never logged and real last logon information of accounts and manage inactive accounts.

    RépondreSupprimer