Share via


Get User Profile Properties by Using SharePoint UserProfileService.asmx Web Services

 
The following code snippets will get the user profiles properties both OOB and Custom:

Profiles.UserProfileService UPS = new Profiles.UserProfileService();
 UPS.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
 UPS.PreAuthenticate = true;
 PropertyData custom = UPS.GetUserPropertyByAccountName("domain\\FirstName.LastName", "CustomID");
 string val = Custom.Values[0].Value.ToString();