473,386 Members | 1,720 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.

System.DirectoryServices name space

All,

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
them.

Basically, I have a VB.net 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 VB.net app is a member of a given security group within
active directory.

For example, user 'Joe Bloggs' is running MyApp.exe (which is a VB.net 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
'AccountManagers'.

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.
Feb 12 '07 #1
2 4067
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.
Cheers,
Paul.

"Newbie Coder" <ne*********@spammeplease.comwrote in message
news:Or**************@TK2MSFTNGP03.phx.gbl...
>I have searched Google & there are 100's of examples in VB.NET:

Example:

http://www.vbdotnetheaven.com/Upload...2-917b6d693465

http://www.devasp.net/net/articles/display/165.html

http://www.codeproject.com/vb/net/LDAP_Using_VBnet.asp

http://www.planet-source-code.com/vb...=177&lngWId=10

http://www.planet-source-code.com/vb...4439&lngWId=10

http://www.planet-source-code.com/vb...=200&lngWId=10

http://www.planet-source-code.com/vb...5483&lngWId=10

I hope these help,

--
Newbie Coder
(It's just a name)


Feb 13 '07 #3

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

Similar topics

3
by: Sean | last post by:
I figured I'd start this post on the .NET general forum instead of the ADSI forum but feel free to nudge me along if I am looking in the wrong place. I am working with System.DirectoryServices...
12
by: hykim | last post by:
Hello, everyone. according to MSDN, there is any constructor of System.DirectoryServices.SearchResultCollection Class. if I implement DirectorySearcher.FindAll() method by myself, then how can I...
1
by: Jason Gleason | last post by:
I am using the following method in a web service that utilizes the system.directoryservices namespace: public ArrayList GetAllAppPools(){ System.DirectoryServices.DirectoryEntry apppools = new...
3
by: Chad Beckner | last post by:
I am starting to translate some code from ASP to ASP.NET (VB). I was able to query ADS to get a users groups that they belong to, and also query a group and get a list of users. However, I can't...
3
by: Rainer Queck | last post by:
Hi NG, I am trying to get system information like Windows Registration Number / Mac-Address. Asking Mr. Googles I found out, that WMI is what I need. In the MSDN Library I found (might not be...
6
by: Mark Rae | last post by:
Hi, I'm in the process of updating an ASP.NET v1.1 web app to v2. The app uses ActiveDirectory a great deal, and I'm trying to use the new System.Collections.Generic namespace where possible,...
1
by: sasikumarks | last post by:
Hi, Im using the following code to retrieve the user details from the AD server. But when i execute the code,it throws me the error. Please help me in this...
1
by: aamirghanchi | last post by:
Hi, I recently converted an ASP .net 1.1 project to 2.0 in VS 2005. Even though System.DirectoryServices reference has been added to the project, still for some reasons the Imports...
7
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am using this code to get groups for a user and getting a error (5) on the GetAuthorizationGroups() function . There are two domains. This function works on the local domain but does not work...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.