#include <LocalSecurityAuthority.au3>
Local $aSecur, $aAceList, $sSecurInfo, $sShare = "MyShare"
$aSecur = _GetNamedSecurityInfo($sShare, $SE_LMSHARE, 4)
If $aSecur[0] = 0 And $aSecur[6] = 0 Then
Msgbox(0, $sShare, "Full Control.")
Else
$aAceList = _GetExplicitEntriesFromAcl($aSecur[6])
For $i = 1 To $aAceList[0][0]
$sSecurInfo &= "Ace Trustee:" & @Tab & $aAceList[$i][0] & @CRLF
$sSecurInfo &= "Trustee Sid:" & @Tab & $aAceList[$i][1] & @CRLF
If $aAceList[$i][3] = $GRANT_ACCESS Then
$sSecurInfo &= "Access Type:" & @Tab & "Granted" & @CRLF
Else
$sSecurInfo &= "Access Type:" & @Tab & "Denied" & @CRLF
EndIf
$sSecurInfo &= "Permissions:" & @CRLF
If $aAceList[$i][2] = 0x1F01FF Then
$sSecurInfo &= @Tab & "Full Control." & @CRLF
ElseIf $aAceList[$i][2] = 0x1200A9 Then
$sSecurInfo &= @Tab & "Read-only." & @CRLF
Else
$sSecurInfo &= @Tab & "None." & @CRLF
EndIf
$sSecurInfo &= @CRLF
Next
Msgbox(0, $sShare, $sSecurInfo)
EndIf
|