Author: mickwalker | Posted on: 6/19/2008 1:28:44 AM | Views : 486

When using the AD Membership provider, I access the users objectSID using:

 Dim mu As MembershipUser = Membership.GetUser(Username, True)
Dim objectSID As Guid = New Guid(mu.ProviderUserKey.ToString)
 The problem is that I get the error message:

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

?mu.ProviderUserKey.ToString

"S-1-5-21-3444464302-3429344031-2204545056-110765"

It seems that active directory doesnt save the provider key as a guid. Is this correct?
...

Go to the complete details ...