Get a UserProfile
[void][reflection.assembly]::Loadwithpartialname(“Microsoft.Office.Server”);
$site=new-object Microsoft.SharePoint.SPSite(“http://sharepoint-site-url”);
$serviceContext = Get-SPServiceContext $site;
$site.Dispose();
$upm = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext);
$userProfile = $upm.GetUserProfile(“domain\username”);

Set property value
$userProfile[“property_internalname”].Value = “property value”;
$userProfile.Commit();

LEAVE A REPLY

Please enter your comment!
Please enter your name here