SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get Sid values for picker entities.. PickerEntity does not have any Sid field..

I can check every PickerEntity find the type (i.e. user, group) then load SPUser etc to get the Sid.

Is there an cleaner way to get Sid's from PickerEntities ?


share|improve this question

Something like this should do the trick:

ServerContext ctx = ServerContext.GetContext("Litware SSP");
UserProfileManager mgr = new UserProfileManager(ctx);

PickerEntity selectedEntity = (PickerEntity)PeopleEditor1.ResolvedEntities[0];
UserProfile profile = mgr.GetUserProfile(selectedEntity.Key);

string selectedSid = profile["SID"].Value.ToString();

Read the post PeopleEditor Control for details.

share|improve this answer
thanks,but that functionality requires MOSS, I have to be compatible with WSS 3.. – Gokhan B. Jun 15 '11 at 13:59

The GetUserInfo operation of the UserGroup.asmx web service contains the SID that can be parsed out if you can utilize that.

<?xml version="1.0"?>
<GetUserInfo xmlns=""><User IsDomainGroup="False" IsSiteAdmin="False" Notes="" Email="" LoginName="domain\alexandere" Name="Pirate, Eric" Sid="S-1-5-21-2072177302-1958620249-3085007271-234531" ID="1"/>

Meaning that after a user is selected from the people picker, you can use that value to call the web service to retrieve the SID.

share|improve this answer
I try not to use WebService since I'm already in sharepoint context.. do you know any other way ? – Gokhan B. Jun 15 '11 at 13:59
Not that I'm aware of, but I'm not a C# developer. I deal mainly with jQuery and DVWPs so I'm used to the web services route. – Eric Alexander Jun 15 '11 at 14:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.