Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
873 B

  1. on error resume next
  2. while true
  3. 'connect to sms
  4. Set Locator = CreateObject("WbemScripting.SWbemLocator")
  5. Set Context = CreateObject("WbemScripting.SWbemNamedValueSet")
  6. Set Services = Locator.ConnectServer("WSMS2", "Root\SMS\Site_WN2", "smsadmin", "Elvis1")
  7. 'Execute "GetSessionHandle" method and store result in our context object
  8. Context.Add "SessionHandle", Services.ExecMethod("SMS_SiteControlFile", "GetSessionHandle").SessionHandle
  9. 'Grab an SMS_SCI_Address object
  10. Set Address = Services.Get("SMS_SCI_Address", , Context).SpawnInstance_
  11. 'Set necessary properties
  12. Address.Addresstype = "MS_LAN"
  13. Address.DesSiteCode = "WN2"
  14. Address.ItemName = "WN2|MS_LAN"
  15. Address.ItemType = "Address"
  16. Address.SiteCode = "WN2"
  17. 'Put (crash occurs here)
  18. Set Path = Address.Put_(wbemChangeFlagCreateOnly, Context)
  19. WScript.Echo Path.RelPath
  20. wend