Voila, tous le monde connait ce script (ou pas) pour lister les droits, mais la c'est en liste et je souhaiterais qu'il soit en tableau, mais je sais pas du tout comment le remplir proprement...


Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
 
SelDir = ""
SelectDir
 
Sub SelectDir
 
 
    SelDir = B("Choisissez un dossier")
 
    If IsNull(SelDir) Then
       MsgBox "Sélection invalide"
    else
       Affich
    End If
 
End Sub
 
Sub Affich
 
    Set objExplorer = WScript.CreateObject ("InternetExplorer.Application")
    objExplorer.Navigate "about:blank"
    objExplorer.ToolBar = 0
    objExplorer.StatusBar = 0
    objExplorer.Width = 600
    objExplorer.Height = 800
    objExplorer.Left = 20
    objExplorer.Top = 20
 
    ' Temporisation pour laisse le temps à IE de se charger
    Do While (objExplorer.Busy)
       Wscript.Sleep 200
    Loop
 
    ' Affichage de l'objet IE à l'ecran
    objExplorer.Visible = 1
    objExplorer.Document.WriteLn "<title>Logs</Title>"
    objExplorer.Document.WriteLn "<body bgcolor=#000066>"
    objExplorer.Document.WriteLn "<div><center><font size=2 face=""Arial"" color=white> Autorisations :</div></center>"
 
    ' Création de l'objet collection de repertoires
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(SelDir)
 
    ' Création de la collection des sous répertoires
    Set colSubfolders = objFolder.SubFolders
 
    ' Parcours des sous répertoires
    For Each objSubFolder in colSubfolders
	strFolderName = objFolder & "\" & objSubfolder.Name
	If intControlFlags = 33796 Then
	   InHer = "Heritage on"
	Else
	   InHer = "Heritage off"
	End If
	objExplorer.Document.WriteLn "<br><font color=yellow>" & strFolderName  & " - " & InHer & "</font><br>"
	' 
	SE_DACL_PRESENT = &h4
	ACCESS_ALLOWED_ACE_TYPE = &h0
	ACCESS_DENIED_ACE_TYPE  = &h1
	FILE_ALL_ACCESS         = &h1f01ff
	FOLDER_ADD_SUBDIRECTORY = &h000004
	FILE_DELETE             = &h010000
	FILE_DELETE_CHILD       = &h000040
	FOLDER_TRAVERSE         = &h000020
	FILE_READ_ATTRIBUTES    = &h000080
	FILE_READ_CONTROL       = &h020000
	FOLDER_LIST_DIRECTORY   = &h000001
	FILE_READ_EA            = &h000008
	FILE_SYNCHRONIZE        = &h100000
	FILE_WRITE_ATTRIBUTES   = &h000100
	FILE_WRITE_DAC          = &h040000
	FOLDER_ADD_FILE         = &h000002
	FILE_WRITE_EA           = &h000010
	FILE_WRITE_OWNER        = &h080000
 
	' Instanciation de l'objet permettant de lire les DACLs
	Set objWMIService = GetObject("winmgmts:")
	Set objFolderSecuritySettings = objWMIService.Get("Win32_LogicalFileSecuritySetting='" & strFolderName & "'")
	intRetVal = objFolderSecuritySettings.GetSecurityDescriptor(objSD)
	intControlFlags = objSD.ControlFlags
 
	' Teste si l'objet peut admettre des paramètres de sécurité
	If intControlFlags AND SE_DACL_PRESENT Then
 
	   arrACEs = objSD.DACL
 
	   ' Affiche les DACLs des sous repertoires
		For Each objACE in arrACEs
			' On affiche le DACL en cours et on met en évidence les autorisations existantes
 
			If Len(objACE.Trustee.Domain) > 0 Then
			   DomName = objACE.Trustee.Domain
			Else
			   DomName = "Local"
			End If
			XZne = "<br>" 
			If objACE.AccessMask AND FILE_ALL_ACCESS Then
			   XZne = XZne & "Contrôle total" & "<br>"
			End If
			If objACE.AccessMask AND FILE_APPEND_DATA Then
		   	   XZne = XZne  & "Création de dossier / Ajout de données" & "<br>"
			End If
			If objACE.AccessMask AND FILE_DELETE Then
			   XZne = XZne  & "Suppression" & "<br>"
			End If
			If objACE.AccessMask AND FILE_DELETE_CHILD Then
			   XZne = XZne  & "Suppression de sous-dossier & fichier" & "<br>"
			End If
			If objACE.AccessMask AND FILE_EXECUTE Then
			   XZne = XZne  & "Parcours du dossier / éxécuter le fichier" & "<br>"
			End If
			If objACE.AccessMask AND FILE_READ_ATTRIBUTES Then
			   XZne = XZne  & "Attributs de lecture" & "<br>"
			End If
			If objACE.AccessMask AND FILE_READ_CONTROL Then
			   XZne = XZne  & "Autorisation de lecture" & "<br>"
			End If
			If objACE.AccessMask AND FILE_READ_DATA Then
			   XZne = XZne  & "Liste du dossier / lecture de données" & "<br>"
			End If
			If objACE.AccessMask AND FILE_READ_EA Then
			   XZne = XZne  & "Lecture des attributs étendus" & "<br>"
			End If
			If objACE.AccessMask AND FILE_SYNCHRONIZE Then
			   XZne = XZne  & "Synchronize" & "<br>"
			End If
			If objACE.AccessMask AND FILE_WRITE_ATTRIBUTES Then
			   XZne = XZne  & "Attributs d'ecriture" & "<br>"
			End If
			If objACE.AccessMask AND FILE_WRITE_DAC Then
			   XZne = XZne  & "Modification des autorisations" & "<br>"
			End If
			If objACE.AccessMask AND FILE_WRITE_DATA Then
			   XZne = XZne  & "Création de Fichier / écriture de données" & "<br>"
			End If
			If objACE.AccessMask AND FILE_WRITE_EA Then
			   XZne = XZne  & "Ecriture d'attributs étendus" & "<br>"
			End If
			If objACE.AccessMask AND FILE_WRITE_OWNER Then
			   XZne = XZne  & "Appropriation" & "<br>"
			End If
 
			XZne = XZne & "<br>"
 
			objExplorer.Document.WriteLn DomName & " - " & objACE.Trustee.Name				  
 
			If objACE.AceType = ACCESS_ALLOWED_ACE_TYPE Then
 
			   objExplorer.Document.WriteLn "<br>"
			   objExplorer.Document.WriteLn "<font color=cyan>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Autorisé à : </font><br>"
			   objExplorer.Document.WriteLn "<font color=Red>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & Xzne & "</font>"
			Else
			   If objACE.AceType = ACCESS_DENIED_ACE_TYPE Then
				  objExplorer.Document.WriteLn vbTab & "<br><font color=tomato>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vous est interdit : </font><br>"
				  objExplorer.Document.WriteLn "<font color=Red>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & Xzne & "</font>"
			   End If
			End If 	  
		Next
 
		VarUserDACL="NO"
 
	Else
		WScript.Echo "No DACL present in security descriptor"
	End If
   Next
 
   objExplorer.Document.WriteLn vbTab & "<br><font color=tomato>----- FIN DE TRAITEMENT -----</font><br>"
 
End Sub
 
Function B(Msg)
	On Error Resume Next
	Dim a,f,i,w
	Set a=WScript.CreateObject("Shell.Application")
 
	Set f=a.BrowseForFolder(&H0&,Msg,&h1&)
	B=f.ParentFolder.ParseName(f.Title).Path
 
	If Err.Number<>0 Then
		B=Null
		If f.Title="Desktop" Then B=w.SpecialFolders("Desktop")
		i=InStr(f.Title, ":")
		If i>0 Then B=Mid(f.Title,i-1,2) & "\"
	End If
End Function
un style comme ça :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
<body text=white><style type='text/css'>
a:link {color: #F19105;}
a:visited {color: #F19105;}
a:active {color: #F19105;}
a:hover {color: #FF9900;background-color: rgb(255, 255, 255);}
</style>
<center><h2><B> Autorisation </B></h2></center>
<center><body bgcolor=#1234568><table border='3' cellpadding='1' style='border-collapse: collapse; font size:11pt' bordercolor='#CCCCCC' width='100%' id='Table1'></center>
<td><center><strong>Chemin :</strong></center></td>
<td><center><strong>Utilisateur :</strong></center></td>
<td><center><strong>Vous est interdit :</strong></center></td>
<td><center><strong>Vous est autorisé :</strong></center></td>