Posts Tagged: scripting


18
Apr 08

How to remove 1000 inactive computer records from Active Directory?

Today I got request from our MIS staff to remove about 1000 computer records from AD. Of course some script needed. Here is 5-minutes solution (use with caution!):

Add-PSSnapin Quest.ActiveRoles.ADManagement
  • Run this:
gc C:\scripts\targets.txt| % { Get-QADComputer -name $_ } | % { Remove-QADObject -force $_.DN }

And one more time – use with extreme caution. Be sure you are removing exactly what you need.