System.DirectoryServices name space


Paul Hadfield


Can anyone help with an example of how to use the System.DirectoryServices
name space?

I've found examples on Google in C# but I've had no success trying to use

Basically, I have a 2003 app running in a 2003 active directory
environment. The app needs to query active directory to see if the user
which is running the app is a member of a given security group within
active directory.

For example, user 'Joe Bloggs' is running MyApp.exe (which is a app)
while logged onto a Windows XP PC in a 2003 active directory domain called
'Company.local'. MyApp.exe needs to check to see if the current locally
logged on user (Joe Bloggs) is a member of a security group called

I'm sure I need to use the System.DirectoryServices name space but I can't
figure out how to use the name space?

Many thanks in advance,

Paul Hadfield

Thanks for these, but I'm still not quite there.

I've been able to run simple query's from AD without a problem, it's the bit
about determining if 'Joe Bloggs' is a member of the 'AccountManagers'
security group that I'm struggling on.


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