Does a System.DirectoryServices.AccountManagement.Principal ever have a null GUID?

Posted by Josh on Stack Overflow See other posts from Stack Overflow or by Josh
Published on 2010-04-28T14:44:13Z Indexed on 2010/04/28 19:27 UTC
Read the original article Hit count: 293

I have a situation where I need to store a globally unique identifier that points to an Active Directory user account. I'm leaning towards the Guid because it is easier to store than the Sid.

According to the MSDN entry, the property (which is a Nullable), will always return null if the ContextType is set to "Machine." I don't need to worry about this because our ContextType will always be set to "Domain."

My question is, will this property ever return null if the ContextType is "Domain"? In other words, will an account in an AD DS store always have a Guid?

© Stack Overflow or respective owner

Related posts about c#

Related posts about active-directory