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.

49 lines
1.2 KiB

  1. 'on error resume next
  2. set locator = CreateObject("WbemScripting.Swbemlocator")
  3. locator.security_.privileges.AddAsString "SeDebugPrivilege"
  4. locator.security_.privileges.AddAsString "SeManageVolumePrivilege"
  5. set service = locator.ConnectServer (,"root/default")
  6. set userid = service.get("userid")
  7. WScript.Echo "Before call the following privileges are enabled on the client:"
  8. for each Privilege in userid.security_.privileges
  9. if Privilege.IsEnabled then
  10. WScript.Echo " " & Privilege.Name
  11. end if
  12. next
  13. userid.GetUserID domain, user, impLevel, privilegesArray, enableArray
  14. WScript.Echo ""
  15. WScript.Echo "User: " & domain & "\" & user
  16. WScript.Echo ""
  17. WScript.Echo "Impersonation Level: " & impLevel
  18. WScript.Echo ""
  19. for i = LBound(privilegesArray) to UBound(privilegesArray)
  20. if i = 0 then
  21. str = "Privileges: "
  22. else
  23. str = " "
  24. end if
  25. str = str & privilegesArray(i) & " - "
  26. if enableArray(i) then
  27. str = str & "Enabled"
  28. else
  29. str = str & "Disabled"
  30. end if
  31. WScript.Echo str
  32. next
  33. if err <> 0 then
  34. WScript.Echo "ERROR", "0x" & Hex(Err.Number), Err.Description
  35. end if