|
|
Hi Brett, That's a great question. I wish that I had an answer for you but unfortunately I haven't put together a 2012 edition lab yet so I can't say for sure. If I do find out I will be sure to let you know. Thanks...Eric
I have an environment where we do not have AD web services running which I believe this script uses, is there a way of clearing out "old" machines that are not in AD but are still in the SCCM database as a device?
Is there a way to export the "dead/old" computers into a txt file?
Disregard. I ran the script and it shows it in the output pane anyways. Great script.
Im getting this error: Get-WmiObject : Invalid parameter En línea: 12 Carácter: 14 + $resID = Get-WmiObject -computername $SCCMServer -query "select resourceID f ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~ + CategoryInfo : InvalidOperatio n: (:) [Get-WmiObject] , ManagementExcep tion + FullyQualifiedE rrorId : GetWMIManagemen tException,Micr osoft.PowerShel l.Commands.GetW miObjectCommand
Hi Eric, This looks like exactly what I am looking for but I am having trouble running this Script. I am new to scripting and I'd appreciate if you can give me some assistance with this. I am running into the below error when I run this. Also, Do I need to edit the script and enter my SCCM info or will it prompt me for that while running within power shell? Thank you Eric. WARNING: Error initializing default drive: 'Unable to find a default server with Active Directory Web Services running.'. Get-ADComputer : Unable to find a default server with Active Directory Web Services running. At C:\Users\Administrator\Downloa ds\RemoveOldCom putersFromSCCM. ps1:10 char:31 + $oldComputers = Get-ADComputer <<<< -Filter {PasswordLastSe t -le $old} -Properties * + CategoryInfo : ResourceUnavail able: (:) [Get-ADComputer ], ADServerDownExc eption + FullyQualifiedE rrorId : Unable to find a default server with Active Directory Web Services running.,Micros oft.Ac tiveDirectory.M anagement.Comma nds.GetADComput er Get-WmiObject : Invalid parameter At C:\Users\Admini strator\Downloa ds\RemoveOldCom putersFromSCCM. ps1:17 char:24 + $resID = Get-WmiObject <<<< -computername $SCCMServer -query "select resourceID from sms_r_system where name like `'$computername `'" -Namespace "root\sms\site_ $sitename" + CategoryInfo : InvalidOperatio n: (:) [Get-WmiObject] , ManagementExcep tion
What is the difference between OLD computer account and DEAD computer? Thanks
Hi Ihab, That's a great question. It's really just a semantic issue. OLD and DEAD are effectively the same thing. It's just a matter of how you'd prefer to label the machines which are aged out. Thanks! Eric
Necesito borrar del SCCM las maquinas que fueron borradas del AD. Este script hace esto??? Sino es asi... en base a que parametros el script borra la maquina del SCCM que son "viejas" en el AD ??
This script only removes the "old" accounts by passing the computer name into the SCCM query. For removing dead computers you can use the maintence tasks from SCCM which you will find here: http://technet.microsoft.com/e n-us/library/bb 632595.aspx The specific task you will want is Delete Obsolete Client Discovery Tasks: http://technet. microsoft.com/e n-us/library/bb 632879.aspx
Hello, Please am new to scripting and I will like to use this script to remove old computers from my SCCM server.I saved the script as .vbs and when i run it i get errors. Also when i copied the script to powershell i get error that "The specified module 'ActiveDirectory' was not loaded because no valid module file was found in any module directory" Please help me on this. I will really appreciate if i can be tutored on how to run this script. Thanks.
Hi There, You need to save it as a .ps1 file on your SCCM server to be able to be run in the console. For the Active Directory module, you can follow the instructions on my blog about installing the RSAT (Remote Server Administration Tool) and enabling the Active Directory Module for Windows PowerShell. http://www.discoposse.com/inde x.php/2011/12/1 3/multi-environ ment-powershell -console/ Thanks, Eric