1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
Try
'Dim fichier As String = txt_rep.Text
For Each Fichier As String In My.Computer.FileSystem.GetFiles("C:\ISO", FileIO.SearchOption.SearchAllSubDirectories)
Dim sec As FileSecurity = New FileSecurity(Fichier, AccessControlSections.All)
Dim dacl As AuthorizationRuleCollection = sec.GetAccessRules(True, True, GetType(NTAccount)) 'security identifier pour recupérer le SID à la place du nom
For Each rqt As FileSystemAccessRule In dacl
If (rqt.IdentityReference.Value = "TEST\Util1") Then
MsgBox(rqt.IdentityReference.Value + " Type : " + rqt.AccessControlType.ToString + " Autorisation : " + rqt.FileSystemRights.ToString())
End If
Next
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try |
Partager