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

2 commentaires:

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

    RépondreSupprimer
  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 ( https://blog.netwrix.com/2018/02/15/the-ten-best-free-active-directory-management-tools/ ) which generates reports on inactive user accounts who never logged and real last logon information of accounts and manage inactive accounts.

    RépondreSupprimer