|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How can I access more properties of the AD AcountIm 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 You would probably want to use issue an LDAP query to AD using
System.DirectoryServices to get this information. Joe K. Show quoteHide quote "@rturo" <rt***@discussions.microsoft.com> wrote in message news:4BECCDF5-CC03-407F-8076-987E27FEEF8B@microsoft.com... > 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 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. Show quoteHide quote "@rturo" <rt***@discussions.microsoft.com> wrote in message news:0633EF8F-64CD-4A97-B33D-09BAF9D550F8@microsoft.com... > Do you have some links about doing this with c#? > 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? Show quoteHide quote "Joe Kaplan (MVP - ADSI)" wrote: > 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. > > "@rturo" <rt***@discussions.microsoft.com> wrote in message > news:0633EF8F-64CD-4A97-B33D-09BAF9D550F8@microsoft.com... > > Do you have some links about doing this with c#? > > > > > 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. Show quoteHide quote "@rturo" <rt***@discussions.microsoft.com> wrote in message news:6DDCFD88-3569-443F-9CCC-28D997951FD3@microsoft.com... > 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? > > "Joe Kaplan (MVP - ADSI)" wrote: > >> 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. >> >> "@rturo" <rt***@discussions.microsoft.com> wrote in message >> news:0633EF8F-64CD-4A97-B33D-09BAF9D550F8@microsoft.com... >> > Do you have some links about doing this with c#? >> > >> >> >> 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 Show quoteHide quote "Joe Kaplan (MVP - ADSI)" wrote: > 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. > > "@rturo" <rt***@discussions.microsoft.com> wrote in message > news:6DDCFD88-3569-443F-9CCC-28D997951FD3@microsoft.com... > > 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? > > > > "Joe Kaplan (MVP - ADSI)" wrote: > > > >> 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. > >> > >> "@rturo" <rt***@discussions.microsoft.com> wrote in message > >> news:0633EF8F-64CD-4A97-B33D-09BAF9D550F8@microsoft.com... > >> > Do you have some links about doing this with c#? > >> > > >> > >> > >> > > > 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. Show quoteHide quote "@rturo" <rt***@discussions.microsoft.com> wrote in message news:E080350D-F2BC-415B-A036-ED0CCC3771F1@microsoft.com... > 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 > > "Joe Kaplan (MVP - ADSI)" wrote: > >> 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. >> >> "@rturo" <rt***@discussions.microsoft.com> wrote in message >> news:6DDCFD88-3569-443F-9CCC-28D997951FD3@microsoft.com... >> > 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? >> > >> > "Joe Kaplan (MVP - ADSI)" wrote: >> > >> >> 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. >> >> >> >> "@rturo" <rt***@discussions.microsoft.com> wrote in message >> >> news:0633EF8F-64CD-4A97-B33D-09BAF9D550F8@microsoft.com... >> >> > Do you have some links about doing this with c#? >> >> > >> >> >> >> >> >> >> >> >> 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 Show quoteHide quote "Joe Kaplan (MVP - ADSI)" wrote: > 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. > > "@rturo" <rt***@discussions.microsoft.com> wrote in message > news:6DDCFD88-3569-443F-9CCC-28D997951FD3@microsoft.com... > > 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? > > > > "Joe Kaplan (MVP - ADSI)" wrote: > > > >> 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. > >> > >> "@rturo" <rt***@discussions.microsoft.com> wrote in message > >> news:0633EF8F-64CD-4A97-B33D-09BAF9D550F8@microsoft.com... > >> > Do you have some links about doing this with c#? > >> > > >> > >> > >> > > > 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. Show quoteHide quote "@rturo" <rt***@discussions.microsoft.com> wrote in message news:A207A208-F438-4942-9DA4-3DBA8217785C@microsoft.com... >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 > > "Joe Kaplan (MVP - ADSI)" wrote: > >> 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. >> >> "@rturo" <rt***@discussions.microsoft.com> wrote in message >> news:6DDCFD88-3569-443F-9CCC-28D997951FD3@microsoft.com... >> > 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? >> > >> > "Joe Kaplan (MVP - ADSI)" wrote: >> > >> >> 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. >> >> >> >> "@rturo" <rt***@discussions.microsoft.com> wrote in message >> >> news:0633EF8F-64CD-4A97-B33D-09BAF9D550F8@microsoft.com... >> >> > Do you have some links about doing this with c#? >> >> > >> >> >> >> >> >> >> >> >>
Client/Server application with single login-SecureStream?
Securing a .NET webapp with ActiveDir and SQL-server? Issuing X.509 Certificates System.Security.SecurityException: Request failed. authentication problem migrating a Winform+WS to asp.net20+WS deploying a group policy to grant signed assemblies FULLTRUST How to make Windows inaccessible from my software user? Using caspol to import a strong name codegroup RSACryptoServiceProvider throw exception on .net 2.0? Couldn;t load assembly |
|||||||||||||||||||||||