I'm trying to integrate (connect) SharePoint 2013 and Exchange 2013 (on-premise), by following this instructions.
- I've successfully ran Configure-EnterprisePartnerApplication.ps1 at the Exchange side.
- I've successfully ran New-SPTrustedSecurityTokenIssuer at the SharePoint side.
But when I try to configure permissions on SP:
$exchange=Get-SPTrustedSecurityTokenIssuer
$app=Get-SPAppPrincipal -Site https://spsite.domain.com -NameIdentifier $exchange.NameId
$site=Get-SPSite http://spsite.domain.com
Set-SPAppPrincipalPermission –AppPrincipal $app –Site $site.RootWeb –Scope sitesubscription –Right fullcontrol -EnableAppOnlyPolicy
In the second line I'm getting the following error:
Get-SPAppPrincipal : Cannot validate argument on parameter 'NameIdentifier'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.
I've recreated Trusted Security Token Issuer with Remove-SPTrustedSecurityTokenIssuer and again New-SPTrustedSecurityTokenIssuer, and then I've noticed that NameId is blank:
IsSelfIssuer : False NameId : RegisteredIssuerName : <some-guid-like-string>@domain.com ...
I've probably forget to do some configuration. Any guess?
Thanks
Fat Dragon