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

2 commentaires:

  1. Ce commentaire a été supprimé par l'auteur.

  2. 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 ( ) which generates reports on inactive user accounts who never logged and real last logon information of accounts and manage inactive accounts.