Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting computers via WMI

Status
Not open for further replies.

lupidus

MIS
Jun 1, 2003
30
US
In the SMS scripting reference provided by Microsoft, I have found the following information about deleting objects in SMS via WMI:

Get the instance of the required SMS object by using GetObject and supplying the path to the required object. For example, to get an instance of an advertisement object (SMS_Advertisement) identified as 99920003, use the following code:

Set objAdvertisement = GetObject( "WinMgmts:root\SMS\site_999:SMS_Advertisement.AdvertisementID='99920003'")

Delete the SMS object instance by using the SMS object class Delete_ method. For example, to delete the advertisement object opened in step 1, use the following code:

objAdvertisement.Delete_

However, I would like to be able to delete a computer via SMS and haven't found any object that seems relevant. I see they are using SMS_Advertisement above. Does anyone have any code samples for deleting various types of objects in SMS via VBscript/WMI?

Thanks for any help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top