Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Security / January 2006

Tip: Looking for answers? Try searching our database.

How can I access more properties of the AD Acount

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
@rturo - 16 Jan 2006 19:41 GMT
Im developing a c# application and i want to access properties like the name
of the person. example:

DOMAIN\jsmith - I want to Access "John Smith" the same way Share Point does
for the its users.

Please help me. Thanks
Joe Kaplan (MVP - ADSI) - 16 Jan 2006 21:42 GMT
You would probably want to use issue an LDAP query to AD using
System.DirectoryServices to get this information.

Joe K.

> Im developing a c# application and i want to access properties like the
> name
[quoted text clipped - 5 lines]
>
> Please help me. Thanks
@rturo - 16 Jan 2006 22:17 GMT
Do you have some links about doing this with c#?
Joe Kaplan (MVP - ADSI) - 17 Jan 2006 03:33 GMT
I would start here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sds/sds/portal.
asp?frame=true


You might also consider doing some additional web searches as well.  This
question comes up pretty frequently.

Joe K.

> Do you have some links about doing this with c#?
@rturo - 17 Jan 2006 20:16 GMT
That was very helpful :)

Now that I've learned to do that, what do you think is the best field to
store in a database to identify an AD user?

> I would start here:
>
[quoted text clipped - 6 lines]
>
> > Do you have some links about doing this with c#?
Joe Kaplan (MVP - ADSI) - 18 Jan 2006 02:55 GMT
objectGUID by far.  The user's objectGUID is a normal Windows GUID structure
(stored in binary) that is rename safe, so it makes a good durable foreign
key.  You can create a column of type uniqueidentifier in SQL to store it
and use that for your join.

Joe K.

> That was very helpful :)
>
[quoted text clipped - 11 lines]
>>
>> > Do you have some links about doing this with c#?
@rturo - 25 Jan 2006 16:17 GMT
Now I have the problem of reading the binary content of objectGUID to store
it in SQL Database and how o convert it again to binary to search into AD.

Where is the best place to get that help?

Thank you

> objectGUID by far.  The user's objectGUID is a normal Windows GUID structure
> (stored in binary) that is rename safe, so it makes a good durable foreign
[quoted text clipped - 18 lines]
> >>
> >> > Do you have some links about doing this with c#?
Joe Kaplan (MVP - ADSI) - 25 Jan 2006 17:50 GMT
The Guid structure in .NET does all of the heavy lifting for you.

When you read the objectGUID from AD has byte array, pass that to the
contructor of Guid that takes a byte array.

When working with SqlParameters, make sure you use the Guid type there.

When reading from SQL, you'll get a Guid structure back.  You can then call
ToByteArray to get the binary back.

Joe K.

> Now I have the problem of reading the binary content of objectGUID to
> store
[quoted text clipped - 30 lines]
>> >>
>> >> > Do you have some links about doing this with c#?
@rturo - 25 Jan 2006 17:25 GMT
I found some help on converting the objectGUID Attribute of an AD Object to a
GUID through the GUID Structure in .NET Framework but when i try to search
for the same object with that GUID, I can't find the object.

Please help me

Thanks

> objectGUID by far.  The user's objectGUID is a normal Windows GUID structure
> (stored in binary) that is rename safe, so it makes a good durable foreign
[quoted text clipped - 18 lines]
> >>
> >> > Do you have some links about doing this with c#?
Joe Kaplan (MVP - ADSI) - 25 Jan 2006 18:20 GMT
Filters for binary data in LDAP look like this:

(objectGUID=\2B\C2\66\4B\E0\4E\20\40\B6\E6\3C\81\A1\BD\A3\31)

Here, each byte is converted into a hex string of two letters and gets an
added \ in front.

You can do this easily by looping over the byte array and using the
ToString("X2") format specifier on the byte to build up a string with a
StringBuilder.

Joe K.

>I found some help on converting the objectGUID Attribute of an AD Object to
>a
[quoted text clipped - 31 lines]
>> >>
>> >> > Do you have some links about doing this with c#?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.