PC Review


Reply
Thread Tools Rate Thread

Active Directory get extensionAttribute

 
 
=?Utf-8?B?UGhpbA==?=
Guest
Posts: n/a
 
      4th May 2007
Can someone explain to me how to find the value of a particular user's
extensionAttribute1 in C#.

I get this far and then have no idea what to do next.

DirectoryEntry dsDirectoryEntry = new DirectoryEntry("LDAP://domain",
username, password);

I don't understand how to use the DirectorySearcher class.

Thanks,

Phil

 
Reply With Quote
 
 
 
 
shashank kadge
Guest
Posts: n/a
 
      4th May 2007
On May 4, 12:57 pm, Phil <P...@discussions.microsoft.com> wrote:
> Can someone explain to me how to find the value of a particular user's
> extensionAttribute1 in C#.
>
> I get this far and then have no idea what to do next.
>
> DirectoryEntry dsDirectoryEntry = new DirectoryEntry("LDAP://domain",
> username, password);
>
> I don't understand how to use the DirectorySearcher class.
>
> Thanks,
>
> Phil


Boy, it looks u need to go a long way from here....
anyways here the code....

oSearcher = new DirectorySearcher(oDirectoryEntry);
oSearcher.Filter="(&(objectClass=user)(objectCategory=user)
(sAMAccountName=Phil))"; // filter to get user accounts

oSearchCollection = oSearcher.FindAll(); // Finds all the user
accounts
if(oSearchCollection != null)
{
if(oSearchCollection.Count > 0)
{
foreach(SearchResult oResult in oSearchCollection) // gets each user
account into oResult.
{
if(oResult.Properties.Contains("extensionAttribute1")) // checks if
the user account has extensionAttribute1
{
sGroupDistinguishedName = oResult.Properties["extensionAttribute1"]
[0].ToString()
}
}
}
}

-
shashan kadge

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question on upgrading from active directory 2000 to active directory 2003 Gary M Microsoft Windows 2000 Active Directory 2 16th Mar 2007 07:57 PM
Active Directory, Active Directory Federation Services and Microsoft Integration Identiy Server Mas Libman [MSFT] Microsoft Windows 2000 Active Directory 0 6th May 2005 10:55 PM
[Active Directory] On what ground does LDAP connect to Active Directory RTT Microsoft VB .NET 0 12th Apr 2005 04:20 PM
Arguments for 2003 Active directory versus 2000 active directory? =?Utf-8?B?c3RlcGhlbmJiYWtlcg==?= Microsoft Windows 2000 Active Directory 4 23rd Dec 2003 04:40 AM
compatibility between W2K Active Directory and W2k3 Active Directory Dani Microsoft Windows 2000 Active Directory 1 15th Sep 2003 11:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:18 PM.