web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / New Service principal ...
Power Apps
Answered

New Service principal script fails on getting the TenantId

(0) ShareShare
ReportReport
Posted on by

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?

I have the same question (0)
  • Alejandro Cesetti Profile Picture
    7 on at

    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 

  • Verified answer
    David Jenni Profile Picture
    Microsoft Employee on at

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

     

     



Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard