I keep getting the following error message when follwoing the steps from this Article
\New-CrmServicePrincipal.ps1 : A parameter cannot be found that matches parameter name 'TenantId'.
At line:1 char:1
+ .\New-CrmServicePrincipal.ps1 -TenantLocation "Europe"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-CrmServicePrincipal.ps1], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,New-CrmServicePrincipal.ps1
Is there a solution for this problem?
@Anonymous @Ale1981 I can repro your issue, once I have the 2.x version of the OnlineManagementAPI PS modules installed in my scope.
The 2.x version of this PS module has breaking changes to accommodate the switch to the BAP admin API (as indicated by the major version). This causes the New-CrmServicePrincipal script to fail, as it expects the 1.2.x version. I'll file a bug to update/publish this script to only run with the 1.2.x versions.
To work around for now, I recommend uninstalling the 2.x of OnlineManagementAPI (and install the successor module, Microsoft.PowerApps.Administration.PowerShell)
> Uninstall-Module Microsoft.Xrm.OnlineManagementAPI -MinimumVersion 2.0 -Force
confirm it is removed with:
> gmo -ListAvailable Microsoft.Xrm.OnlineManagementAPI
when running the New-CrmServicePrincipal with the -Verbose switch to confirm it only loads the 1.2.x version (or to produce more detail if there is more debugging necessary)
I am getting the same error. I'll keep working to see if I understand why but if anyone has an answer I look forward to it 😉
FYI @DavidJen
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
82
Super User 2025 Season 1
MS.Ragavendar
72