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.

22 lines
833 B

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