473,386 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using Active Directory to search folder groups

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
Nov 21 '05 #1
1 1375
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.
--

Bob

--------------------------------------
I'll have a B please Bob.

"Garrett" <ag*******@hotmail.com> wrote in message
news:3a**************************@posting.google.c om...
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

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Toufani | last post by:
Hi everybody, I want to retrieve information about objects in active directory windows 2000 and their properties. I got some codes that don't work absolutely. for example I can't retrieve users...
1
by: techfuzz | last post by:
I'm posting my problem experience and solution I found here for other ASP.NET developers. I have a web application that uses Forms Authentication with Active Directory to control access. In...
1
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry =...
4
by: pjdouillard | last post by:
Hello all, Here is the context of my problem: We have an ASP.NET 1.1 application that has its own application pool setup and that runs under the identity of a NT Domain service account (this...
2
by: sgr | last post by:
How do I search an user into the active directory from a c# application? Thanks for all.
0
by: bcanter | last post by:
I found a file on the web that will allow you to enumerate groups but it was an .hta and the top level admins won't allow this. I need to give managers access to the groups so that when a new user is...
2
by: Max Vit | last post by:
I have been toying with the idea of having an Active Directory authentication / authorisation functionality in MS Access; but there is not much useful info around. I have built these...
3
by: interuser | last post by:
Hi I want to enumerate all groups of an active directory. How do I do that? Thanks
2
by: Jim in Arizona | last post by:
I'm trying to do a check to see if a specific active directory user account exists in active directory AND a specific group. I can't seem to get the filter down right. I can do this to find a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.