In one of my previous posts I showed how to create custom AD attribute and map it to user profile property via PowerShell: Create custom AD attribute and map it to Sharepoint user profile property. Regardless of whether you work with custom or standard AD attribute when you add mapping you may get “Unable to process Put message” error. In order to fix it go to Central Administration > Services on Server and restart User profile service and User profile synchronization service ((stop and then start)):
Note that in order to restart User profile synchronization service you will need credentials used by this service for synchronizing profiles. So ensure that you have them before to stop it. After that run your script again, it should run without errors now.