Source code of Windows XP (NT5)
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.

21 lines
862 B

  1. Dim ADSObject
  2. Dim WBEMObject
  3. Dim WBEMServices
  4. ' Get the AD computer object through the ADSI LDAP provider
  5. Set ADSObject = GetObject("LDAP://CN=CORINAFNT5,CN=Computers,DC=ntdev,DC=microsoft,DC=com")
  6. WScript.Echo "Got ADSI Object : "+ADSObject.Name
  7. ' Get the path to the matching WMI object (uses property WMIObjectPath)
  8. WScript.Echo "WMI Object Name is : "+ADSObject.WMIObjectPath
  9. ' Get the matching WMI object itself (uses method GetWMIObject)
  10. Set WBEMObject = ADSObject.GetWMIObject
  11. WScript.Echo "Got WMI Object : "+WBEMObject.Path_.RelPath
  12. ' Get the WMI services pointer associated with the WMI object
  13. Set WBEMServices = ADSObject.GetWMIServices
  14. ' The services pointer can be used for other WMI operations
  15. Set WBEMObject = WBEMServices.Get("Win32_LogicalDisk.DeviceID=""C:""")
  16. WScript.Echo "WMI Object from Services : "+WBEMObject.Path_.RelPath