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.

32 lines
1.0 KiB

  1. '***************************************************************************
  2. 'This script tests the ability to access remote CIMOMs with non-default
  3. 'credentials
  4. '***************************************************************************
  5. On Error Resume Next
  6. Set Locator = CreateObject("WbemScripting.SWbemLocator")
  7. Set Service = Locator.ConnectServer ("lamard3", "root\sms\site_la3", "smsadmin", "Elvis1")
  8. Service.Security_.ImpersonationLevel = 3
  9. Set Site = Service.Get ("SMS_Site.SiteCode=""LA3""")
  10. WScript.Echo Site.Path_.DisplayName
  11. WScript.Echo Site.BuildNumber
  12. WScript.Echo Site.ServerName
  13. WScript.Echo Site.InstallDir
  14. Set cimomId = GetObject ("winmgmts:{impersonationLevel=impersonate}!\\ludlow\root\cimv2:Win32_LogicalDisk=""C:""")
  15. for each Property in cimomId.Properties_
  16. str = Property.Name & " = "
  17. value = Property.Value
  18. if (IsNull(value)) then
  19. str = str & "<null>"
  20. else
  21. str = str & value
  22. end if
  23. WScript.Echo str
  24. next
  25. if Err <> 0 Then
  26. WScript.Echo Err.Description
  27. End if