Hello Team,
I am trying to get the access token for the SharePoint on prem versions, via app-only authentication. In the following thread your team has provided us options to achieve this: https://learn.microsoft.com/en-us/answers/questions/1162405/app-only-authentication-for-sharepoint-server-(on
We have tried with the low trust option and followed the same steps mentioned in following document https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-an-office-365-sharepoint-site-to-authorize-provider-hosted-add-ins-on-an-on to do the set up for App Only Authentication for on premise environment and during execution we faced syntax error when we executed the following command:
Connect-SPFarmToAAD -AADDomain 'sample.onmicrosoft.com' -SharePointOnlineUrl https://sample.sharepoint.com -SharePointWeb https://ec2-11-111-111-111.wi-center-0.compute.shp.com:10987/sites/TestSite
On executing above mentioned command we are getting the following error:
Set-MsolServicePrincipal : Invalid syntax. Parameter Name: ServicePrincipalNames.
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\MySharePointFunctions\MySharePointFunctions.psm1:103 char:9
+ Set-MsolServicePrincipal -AppPrincipalId $SPAppPrincipal.AppP ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Set-MsolServicePrincipal], MicrosoftOnlineException
+ FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.StringSyntaxValidationException,Microsoft.Online.Administration.Automation.SetServicePrincipal
Could you please help and let us know how to resolve this error to proceed with the set up?
If possible, can we please connect over a meeting?
Thanks.