Friday 18 December 2009

Remove old Computer accounts after 6 months

Remove old Computer accounts after 6 months:

dsquery computer "LDAP Query of your workstations" -inactive 26 -limit 0 dsrm -noprompt –c

3 comments:

  1. we use a query with the active roles command applets.

    It shows the password age and last boot time.
    The boot time is replicated for domain controllers 2003 and up.

    i use this commmand line:

    Get-QADComputer -SearchRoot "Domain/computers" -IncludedProperties pwdLastSet, LastLogon -SizeLimit 0 | where { $_.pwdLastSet -le $old }| sort pwdlastset | ft name,pwdlastset,LastLogon -auto

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Thanks for sharing the useful and helpful command, I tried this automate tool ( https://blog.netwrix.com/2018/02/15/the-ten-best-free-active-directory-management-tools/ ) which provides the automate facilitate to disable old computer accounts that have not logged on within x number of days and generate the complete report which are based on old or used user and computer accounts.

    ReplyDelete