Home Authors Posts by Luís Rato

Luís Rato

Luís Rato
0 POSTS 0 COMMENTS

Get UserProfile and set property value with PowerShell

0
Get a UserProfile ::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("domainusername"); Set property value $userProfile.Value = "property value"; $userProfile.Commit();