Striper Talk Striped Bass Fishing, Surfcasting, Boating

     

Left Nav S-B Home FAQ Members List S-B on Facebook Arcade WEAX Tides Buoys Calendar Today's Posts Right Nav

Left Container Right Container
 

Go Back   Striper Talk Striped Bass Fishing, Surfcasting, Boating » Striper Chat - Discuss stuff other than fishing ~ The Scuppers and Political talk » Computers

Computers Sidetrack to Computers, Questions on your home computer? Posting just for registered members....

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 10-17-2007, 07:24 PM   #1
BrianS
Canal Junkie
iTrader: (4)
 
BrianS's Avatar
 
Join Date: May 2003
Location: Raynham
Posts: 1,678
Send a message via AIM to BrianS
C# and Active Directory ***geeky programming question warning***

I have a problem in that I am looking to pull a list of users from Active Directory into my application.

I actually have it working in that I have pulled ALL "users" in, but its also bringing in users that are Inactive.

How can I designate and only pull in "active" users?

This is my code as it works now.. Any assistance would be GREATLY appreciated.


try
{
string path = "LDAP://bosdc1/CN=Users,DC=firm,DC=gsxxx,DC=com";
DirectoryEntry AD = new DirectoryEntry(path);
AD.Username = "GS\\xxxxx";
AD.Password = "xxxxx";

AD.Username = "GS\\xxxxx";
AD.Password = "xxxxx";
AD.Children.SchemaFilter.Add("user");


foreach (DirectoryEntry obj in AD.Children)
{
string replaced = FixString(obj.Name.ToString(), "CN=", "");
replaced = FixString(replaced, "\\", "");
ADUsersList.Items.Add(replaced);
}
}
catch
{
}

aim: SaltedBrian
BrianS is offline   Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:28 PM.


Powered by vBulletin. Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Please use all necessary and proper safety precautions. STAY SAFE Striper Talk Forums
Copyright 1998-20012 Striped-Bass.com