I needed to change some properties of user profiles of my SharePoint 2010 farm.

Of cource I wanted to do this with PowerShell!

Before you can execute the following script, be sure that your user account is “Admin” on your “User Profile Service Application” and has “Full Control” permissions on the same Service App! – You may get this error: New-Object : Exception calling ".ctor" with "1" argument(s): "No User Profile Application available to service the request. Contact your farm administrator." – You can verify or change this settings in the Central Administration –> Manage Service Applications –> (select User Profile Service Application) –> than:

Click “Administrators” –> Add the user that will execute the PowerShell script –> Set “Full Control” for this user –> Click “OK”

Click “Permissions” –> Add the user that will execute the PowerShell script –> Set “Full Control” for this user –> Click “OK”

If you need to write property values than uncomment the two lines on the bottom of the script and change them.

BE VERY CAREFULLY!!!!

You can damage your profile system if you do things wrong! – Be sure that your script will only change one property for one user. If you uncomment the script lines above this script would set the property “FirstName” of every user to value “Test”!!! – BE VERY, VERY CAREFULLY!!!

DISCLAIMER

The informations on my blog are provided as is and I cannot guarantee that editing the registry or executing the provided code or provided scripts or doing other actions described in my articles will not cause serious damage. You use this information at your own risk! - I'm not responsible content on external sites.