Re: Need help getting the domain SID when given a DC=XXX,DC=YYY,CD=ZZZ
- From: "Joe Kaplan \(MVP - ADSI\)" <joseph.e.kaplan@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 11 Aug 2006 22:55:14 -0500
If you want to do this with LDAP (which it looks like you do since you are
using the Domain class), then you could do something like this (you were
almost done!):
Domain curDom = Domain.GetCurrentDomain();
using (DirectoryEntry de = currDom.GetDirectoryEntry())
{
byte[] domSid = (byte[]) de.Properties["objectSid"].Value;
}
If you want a SecurityIdentifier instance, just pass the byte array to the
appropriate constructor.
Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Pucca" <Pucca@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4E060E9E-A1A5-49A4-AC74-B19ACE0A2E56@xxxxxxxxxxxxxxxx
Hi,
I need to get the DomainSID of a given domain. I am using VS2005
C# and .net 2.0. I would most appreciate it if anyone can point me to
some
code
sample.
Domain curDom = Domain.GetCurrentDomain();
--
Thanks.
--
Thanks.
.
- Prev by Date: Re: Finding ALG_ID from algorithm name
- Next by Date: Re: Kerberos ( Web Service)
- Previous by thread: [GINA] Password expires in... warning
- Next by thread: Re: Need help getting the domain SID when given a DC=XXX,DC=YYY,CD
- Index(es):
Relevant Pages
|