Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AD DirectorySearcher properties 1

Status
Not open for further replies.

MasterRacker

Active member
Oct 13, 1999
3,343
US
I'm trying to query AD to get a number of pieces of user information out of it.

I've been able to set up a DirectorySearcher and add search properties via PropertiesToLoad.Add(). My problem concerns not knowing exactly which AD Attributes to look at. I've found a full list of attributes here:
however, this list is a list of common names whereas the DirectorySearcher appears to want LDAP display names. In this particular list I have to click entries one at a time to see those.

Does anyone have a link to a full list of LDAP names?

_____
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
That helped quite a bit. I've at least gotten the basic info I needed with it. Thanks.

_____
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
Since there are literally thousands of attributes, the schema object is there also to help users to "discover" them through code as well. Suffice it to know the right keywords to search through msdn for the original authoritative documentation. I would suggest the right keywords to start searching be "mandatoryproperties" and "optionalproperties" and you'll be overwhelm with informative links.

In vbs, this script segment would be very revelatory even to c# coder. (It use serverless binding to schema to the user class. Same for others.)
[tt]
set oschema=getobject("LDAP://schema/user")

sinfo=""
sinfo="mandatory properties:" & vbcrlf
for each prop in oschema.MandatoryProperties
sinfo=sinfo & prop & vbcrlf
next

sinfo=sinfo & vbcrlf & "optional properties:" & vbcrlf
for each prop in oschema.OptionalProperties
sinfo=sinfo & prop & vbcrlf
Next
msgbox sinfo 'would need alternative way to display if too long the list

set oschema=nothing
[/tt]
I am sure you can quickly get the idea and do it c#'s way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top