I've not seen that syntax before (ie. with a shriek after WinMgmts: and before Win32).
I know its heresy, but my only option at the moment seems to be using the vbs code. It works fine. If I ever get the perl code to work I'll let you know. PS. Try this vbs and see if it hangs...
a = ShowPermissions("computer","sharename")
Function ShowPermissions(ComputerName,ExplicitPath)
Set objSecurity = GetObject("winmgmts:{(Security,Restore)}\\" & Co
+mputerName & _
"\root\cimv2:Win32_LogicalShareSecuritySetting='" & ExplicitPa
+th & "'")
If objSecurity.GetSecurityDescriptor(objSD) = 0 Then
For Each objACE in objSD.DACL
wscript.Echo objACE.Trustee.Domain, objACE.Trustee.Name
PermissionBitMask = objACE.AccessMask
Select Case PermissionBitMask
Case 1179817
wscript.Echo "Read"
Case 1245631
wscript.Echo "Modify"
Case 2032127
wscript.Echo "Full"
Case Else
wscript.Echo "Other: " & PermissionBitMask
End Select
Next
End If
End Function
|