How can I copy the value of one user property to another in SharePoint? We have a custom property called Supervisor which will be entered by the user and I want to copy this property into the Manager field in SharePoint, as the organizational profile is not working without the manager field. I am writing this in PowerShell but it is giving me the following error “Unable to index into an object of type Microsoft.Office.Server.UserProfiles.UserProfile.” My Code is
$consultantsupername = $userProfile["ConsultantSupervisor"]
$Managername =$userProfile["Manager"]
$userProfile["Manager"]=$userProfile["ConsultantSupervisor"]
$userProfile.Commit()
Please help me… Thanks