Below is a script which will delete a list of computers from SMS 2003. And quite possibly SCCM 2007 as well (not tested). It was originally taken from the SMS 2003 Recipe Book, modified by Paul Town, and further improved by me.
The changes I made were:
- the script will read a text file of computers to be deleted, and loop though them.
- ping the computer to be deleted, and if it’s “pingable”, don’t delete it.
- fixed a bug with the WMI GetObject call.
strSMSServer = "WISEFAQ2003"
strSMSSiteCode = ""
Set objFSO = CreateObject("Scripting.FileSystemObject")
If not objFSO.FileExists("C:\computer_lists\sms_deletion.txt") Then