Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting Win32_Service security descriptor using VBScript
    primarykey
    data
    text
    <p>I am using VbScript for retrieving the securitydescriptor of a Win32_Service. I am using the following code:</p> <pre><code> SE_DACL_PRESENT = &amp;h4 ACCESS_ALLOWED_ACE_TYPE = &amp;h0 ACCESS_DENIED_ACE_TYPE = &amp;h1 strComputer = "." Set objWMIService = GetObject("winmgmts:" _ &amp; "{impersonationLevel=impersonate, (Security)}!\\" &amp; strComputer &amp; "\root\cimv2") Set colInstalledPrinters = objWMIService.ExecQuery _ ("Select * from Win32_Service") For Each objPrinter in colInstalledPrinters Wscript.Echo "Name: " &amp; objPrinter.Name ' Get security descriptor for printer Return = objPrinter.GetSecurityDescriptor( objSD ) If ( return &lt;&gt; 0 ) Then WScript.Echo "Could not get security descriptor: " &amp; Return wscript.Quit Return End If ' Extract the security descriptor flags intControlFlags = objSD.ControlFlags If intControlFlags AND SE_DACL_PRESENT Then ' Get the ACE entries from security descriptor colACEs = objSD.DACL For Each objACE in colACEs ' Get all the trustees and determine which have access to printer WScript.Echo objACE.Trustee.Domain &amp; "\" &amp; objACE.Trustee.Name If objACE.AceType = ACCESS_ALLOWED_ACE_TYPE Then WScript.Echo vbTab &amp; "User has access to printer" ElseIf objACE.AceType = ACCESS_DENIED_ACE_TYPE Then WScript.Echo vbTab &amp; "User does not have access to the printer" End If Next Else WScript.Echo "No DACL found in security descriptor" End If Next </code></pre> <p>However, every time I run it I get the message saying the resulting code is -2147023582 something, rather than the error codes defined in <a href="http://msdn.microsoft.com/en-us/library/aa390785%28VS.85%29.aspx" rel="nofollow">the manual</a>.</p> <p>Anyone got any ideas? I am using Windows 7 professional 64-bit.</p> <p>The number is -2147023582. Could it be some sort of 64-bit issue? doesn't that look like a unsigned integer stored as a signed integer?</p> <p>(PS: don't mind the variablenames... I ripped an example off of msdn).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload