Ho referenziato anche Active Ds Type Library per poterlo utilizzare con i gruppi locali.
Come spunto, ti passo la parte di codice che ho utilizzato io:
Private Function test_Local(ByVal hostname As String) As String
Dim return_str As String = ""
Try
Dim MembersCollection As IADsMembers
Dim GroupToEnum As New DirectoryEntry("WinNT://" & hostname & "/administrators,group")
MembersCollection = GroupToEnum.Invoke("Members")
Dim filter As System.Object() = {"user"}
MembersCollection.Filter = filter
Dim user As IADsUser
Dim grp As IADsGroup
For Each user In MembersCollection
return_str = return_str & user.ADsPath.Substring(8) & ";"
Next
Dim grpfilter As System.Object() = {"group"}
MembersCollection.Filter = grpfilter
For Each grp In MembersCollection
return_str = return_str & grp.ADsPath.Substring(8) & ";"
Next
return_str = return_str.Substring(0, (return_str.Length - 1))
Return return_str
Catch ex As Exception
return_str = "NP"
Return return_str
End Try
End Function
Ovviamente è da modificare perchè io l'ho scritta in base alle mie esigenze, ma per prenderne spunto.......
PS: dai un'occhiata anche a http://www.dotnethell.it/articles/Gestire-ACL-NTFS.NET.aspx
Bye
---------------------------------------------------
Roberto Gelmini - Microsoft Certified Professional
www.robertogelmini.com
---------------------------------------------------