You cannot change any properties in the User Profiles via client OM code (neither .NET nor via JavaScript) with the exception of the user's profile picture.
MSDN - Work with user profiles in SharePoint 2013
Not all functionality that you find in the
Microsoft.Office.Server.UserProfiles
assembly is available from client
APIs. For example, you have to use the server object model to create
or change user profiles because they're read-only from client APIs
(except the user profile picture). Also, there's no client-side access
to some namespaces, such as Microsoft.Office.Server.Audience
,
Microsoft.Office.Server.ReputationModel
, or
Microsoft.Office.Server.SocialData
. To see what's supported
functionality for the client APIs, see
Microsoft.SharePoint.Client.Social
and
Microsoft.SharePoint.Client.UserProfiles
.
That being said, there is a legacy web service that might work for you. You can access this via SPServices jQuery plugin pretty easily. Here is an example from Marc Anderson's blog.
Modify User Profile Properties on SharePoint Online 2013 using SPServices
Here's a snip of the code he uses to illustrate the process:
var propertyData = "<PropertyData>" +
"<IsPrivacyChanged>false</IsPrivacyChanged>" +
"<IsValueChanged>true</IsValueChanged>" +
"<Name>" + propertyName + "</Name>" +
"<Privacy>NotSet</Privacy>" +
"<Values><ValueData><Value xsi:type=\"xsd:string\">" + propertyValue + "</Value></ValueData></Values>" +
"</PropertyData>";
$().SPServices({
operation: "ModifyUserPropertyByAccountName",
async: false,
webURL: "/",
accountName: userId,
newData: propertyData,
completefunc: function (xData, Status) {
var result = $(xData.responseXML);
}
});
Here are some server object model examples as requested.
using Microsoft.Office.Server.UserProfiles
//etc...
SPServiceContext serviceContext = SPServiceContext.GetContext(site);
UserProfileManager = new UserProfileManager(serviceContext);
UserProfile = userProfileManager.CreateUserProfile("mydomain\RKaucher");
//Change display Name property label to "Friendly Name".
userProfile.DisplayName = "Friendly Name";
userProfile["FirstName"].Value = "Robert"
userProfile[PropertyConstants.Skills].Add("SharePoint Development");
//Or you can use this method
userProfile[PropertyConstants.Skills][0] = "jQuery";
userProfile.Commit();