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.

36 lines
1.0 KiB

  1. //***************************************************************************
  2. //This script tests the ability to access remote CIMOMs with non-default
  3. //credentials
  4. //***************************************************************************
  5. var Locator = new ActiveXObject("WbemScripting.SWbemLocator");
  6. var Service = Locator.ConnectServer ("lamard3", "root\\sms\\site_la3", "smsadmin", "Elvis1");
  7. Service.Security_.ImpersonationLevel = 3;
  8. var Site = Service.Get ('SMS_Site.SiteCode="LA3"');
  9. var cimomId = GetObject ('winmgmts:{impersonationLevel=impersonate}!\\\\ludlow\\root\\cimv2:Win32_LogicalDisk="C:"');
  10. var e = new Enumerator (cimomId.Properties_);
  11. for (;!e.atEnd();e.moveNext())
  12. {
  13. var Property = e.item ();
  14. str = Property.Name + " = ";
  15. value = Property.Value;
  16. if (value == null) {
  17. str = str + "<null>";
  18. }
  19. else
  20. {
  21. str = str + value;
  22. }
  23. WScript.Echo (str);
  24. }
  25. WScript.Echo (Site.Path_.DisplayName);
  26. WScript.Echo (Site.BuildNumber);
  27. WScript.Echo (Site.ServerName);
  28. WScript.Echo (Site.InstallDir);