3

I'm trying to install our app using the PowerShell and after running the application I get an error while accessing the user profile data. We are using the following permissions in our app:

AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="Read"
AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" 

This is the part of the PowerShell where I set up the permissions:

Register-SPAppPrincipal -DisplayName $appName -NameIdentifier $appIdentifier -Site $web 
$principal =  Get-SPAppPrincipal -Site $siteCollection -NameIdentifier $appIdentifier
Set-SPAppPrincipalPermission -Site $siteCollection -AppPrincipal $principal -Scope SiteSubscription -Right FullControl

If the app is installed from SharePoint it works perfectly, therefore I think the problem lays in the app permissions.

  • You have to give User profile read permission. – Unnie Dec 15 '14 at 9:22
  • Well apparently yes, but how do I do this using PowerShell? – Ciamas Dec 15 '14 at 9:29
  • I think powershell command is not available for that. You can only set app permissions for site,Site collection,Site subscription.Check this technet.microsoft.com/en-us/library/jj219714(v=office.15).aspx. You will have to edit app manifest and add it – Unnie Dec 15 '14 at 9:47
  • Well it is in the app manifest. AppPermissionRequest Scope="sharepoint/social/tenant" Right="Read" AppPermissionRequest Scope="sharepoint/content/tenant" Right="FullControl" Now I need to find the way to add it via PowerShell. – Ciamas Dec 15 '14 at 10:11

Your Answer

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

Browse other questions tagged or ask your own question.