Last post Dec 09, 2010 11:53 PM by vijaypant
Dec 08, 2010 11:21 PM|interorion|LINK
Probably seen this one a million times before but searching has lead to a lot of conflicting information.
I need to retrieve the GUID for the Current User? I've found that it's possible with DirectoryEntry, but is there a way I can do it in similar fashion to WindowsIdentity.GetCurrent.User.Value - which actually returns the SID (as you'd know)?
Dec 09, 2010 12:05 AM|vijaypant|LINK
Hi for forms authentication, you can obtain the GUID as follows:
'Obtain the currently logged in user as a MembershipUser object.
Dim _user As MembershipUser = Membership.GetUser(User.Identity.Name)
'Obtain the guid of the MembershipUser object.
Dim _guid As Guid = _user.ProviderUserKey
'Use the guid obtained.
testDiv.InnerHtml = _guid.ToString()
But for windows authentication, i don't think so that there is any GUID.
Dec 09, 2010 05:56 PM|interorion|LINK
Thanks for your help.
For AD Authentication, there is objectGUID which is what I am trying retrieve.
Dec 09, 2010 11:53 PM|vijaypant|LINK
Hi, may be this post helps you: