Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

Issue with Get-SPWeb and Register-SPAppPrincipal scripts

$
0
0

Hello

 I am trying to register clientID to my provider hosted by running the below script, getting an error at the Register-SPAppPrincipal script. What to do?? Please help me

$appDisplayName = "SharePointApp5.App"
 $clientID = "f2d1bb9e-2566-426a-ab45-91735ec59357"
 $targetSiteUrl = "http://<server:portno>/sites/DemoSite/"
 $targetSite = Get-SPSite $targetSiteUrl
 $realm = Get-SPAuthenticationRealm -ServiceContext $targetSite
 $fullAppPrincipalIdentifier = $clientID + '@' + $realm
 Write-Host "Registering new app principal"
 $registeredAppPrincipal = Register-SPAppPrincipal -NameIdentifier $fullAppPrincipalIdentifier -Site $targetSite.RootWeb -DisplayName $AppDisplayName
 Set-SPAppPrincipalPermission -Site $targetSite.rootweb -appPrincipal  $registeredAppPrincipal -Scope SiteCollection -Right FullControl
 Write-Host "Registration Completed"


Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>