0
votes

When trying to execute a PowerShell command to create a new Service principal for a Multitenant App from Tenant A to Tenant B, where the Tenant B Admin is trying to give consent and register the app from Tenant A using this command:

New-AzureADServicePrincipal -AppId "APP ID GUID"

I am getting this error:

New-AzureADServicePrincipal: Could not load file or assembly 'RestSharp, Version=106.3.1.0, Culture=neutral, PublicKeyToken=598062e77f915f75'. Could not find or load a specific file. (0x80131621)

The PS command is being executed directly in the Azure Portal PowerShell CLI window, on the Tenant B subscription

2
If my answer is helpful for you, you can accept it as answer( click on the check mark beside the answer to toggle it from greyed out to filled in.). This can be beneficial to other community members. Thank you.Carl Zhao

2 Answers

1
votes

I tested this command, and it works well for me:

enter image description here

I think your problem is caused by the Rest Sharp version, you can go to the Nuget package manager, then change the version of Rest Sharp and install it. Similar problem please see:here

0
votes

This should work. Please Create an Azure support request to better address this issue.