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.

35 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. while true
  7. Set Locator = CreateObject("WbemScripting.SWbemLocator")
  8. Set Service = Locator.ConnectServer ("lamard3", "root\sms\site_la3", "smsadmin", "Elvis1")
  9. Service.Security_.ImpersonationLevel = 3
  10. Set Site = Service.Get ("SMS_Site.SiteCode=""LA3""")
  11. WScript.Echo Site.Path_.DisplayName
  12. WScript.Echo Site.BuildNumber
  13. WScript.Echo Site.ServerName
  14. WScript.Echo Site.InstallDir
  15. Set cimomId = GetObject ("winmgmts:{impersonationLevel=impersonate}!\\ludlow\root\cimv2:Win32_LogicalDisk=""C:""")
  16. for each Property in cimomId.Properties_
  17. str = Property.Name & " = "
  18. value = Property.Value
  19. if (IsNull(value)) then
  20. str = str & "<null>"
  21. else
  22. str = str & value
  23. end if
  24. WScript.Echo str
  25. next
  26. if Err <> 0 Then
  27. WScript.Echo Err.Description
  28. End if
  29. wend