Using Active Directory to search folder groups

  • Thread starter Thread starter Garrett
  • Start date Start date
G

Garrett

Hi all,

I am looking for a sample of System.DirectoryServices code that will
allow me to do three things:

1. Iterate over all shared folders on a drive
2. Find the groups that are assigned to each folder
3. Find each user of each group found in step two

Thanks

A
 
To enumerate users of a groups I use this. It not especially elegant, i
know, but works a treat.

Sub NewLoadADUsers(ByVal strDomain, ByVal strGroup)

Dim UserGroup
Dim UserAccount

UserGroup = GetObject("WinNT://" & strDomain & "/" & strGroup) ' &
",group")

For Each UserAccount In UserGroup.Members
Debug.WriteLine(UserAccount.Name)
Next

End Sub

There are plenty of other properties you can use instead of
UserAccount.Name, for example, UserAccount.ProfilePath. You will need to
read MSDN to find out what they are.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top