4

As SP2016 farm administrator, I am trying to work on user profile with PowerShell. Found several examples that use

$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context) 

But when doing for each on the enumerator, I get the error:

UserProfileDBCache_WCFLogging :: ProfileDBCacheServiceClient.GetUserData threw exception: Access is denied.

I also added myself to the service with full control and I am SysAdmin on the SQL instance.

4

Access denied denote to a permission issue, Meanwhile, you are using a user as a farm admin with sysadmin as server role,So my suggestion is to:

  • Make sure that you are running the PowerShell with the farm account (the service account used to configure SharePoint)

  • During provisioning UPS, the farm account must be added to local administrator group.

Note: After adding the farm account to local administrator group, you must restart the SharePoint 2013 Timer service or restart the server.

  • The service account of UPS has a full control permission in the application service settings.
  • Thank you M.Qassas.! Running as the service account did the trick. Whish it was more straight forward. – Ofer Gal Feb 19 '17 at 23:33
  • just Learnt to upvote :-) – Ofer Gal Feb 22 '17 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.