cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

New Service principal script fails on getting the TenantId

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

@Alt-Celinski @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)

 

 



View solution in original post

2 REPLIES 2
Regular Visitor

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 

Microsoft
Microsoft

@Alt-Celinski @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)

 

 



View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Users online (6,861)