Bize Ulaşın / Contact Us

CRM Logo

Disabling Dynamics CRM Admin Mode via Powershell

20 / 02 / 2020 by Uncategorized Yorum yok / No Comments

I needed to Disable one of our CRM instances Admin Mode, I hit the Power Platform Admin Pages, it redirected me to Classic Dynamic 365 Administrator Center, clicked “Admin” for the Instance, it redirected me to Power Platform again and I started to get login error after a few browsers redirects between MS sites, it says “We couldn’t sign you in. Please try again.” Probably an authorisation token issue between MS sites.

I directly headed to Powershell, installed XRM Online Management API

Install-Module -Name Microsoft.Xrm.OnlineManagementAPI -RequiredVersion

And I used Disable-CrmAdminMode to do this, I’m writing these down to save my time if I will face it again, because finding values for parameters takes more time.

Disable-CrmAdminMode (Microsoft.Xrm.OnlineManagementAPI) | Microsoft Docs

We will run this command

Disable-CrmAdminMode -InstanceId ’94…………………1′ -ApiUrl “” -Credential $Cred

So we need your CRM Instance ID, and the ApiURL

The ApiURL here is not your Instance API Url actually this is the Service URL, each CRM Region has it own Service URL so you can find yours from

The following table lists the service URLs of Online Management API for worldwide Office 365 data centres.

LocationService URL
North America
North America 2
Europe, Middle East and Africa (EMEA)
Asia Pacific (APAC)
Japan (JPN)
South America
India (IND)
United Kingdom (UK)

Instance ID can be taken from CRM\Settings\Customisation\Developer Resources or you can run
Get-CrmInstances -ApiUrl “”
to list your instances and find your Id for the respective CRM Instance.

Now we can run our command to disable admin mode for our CRM Instance easily.

$Username = “[email protected]
$Password = “password”
$SecPassword = ConvertTo-SecureString $Password -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential ($Username, $SecPassword)
Disable-CrmAdminMode -Id ‘Your Dynamics CRM Instance ID (GUID)’ -ApiUrl “Your Service URL from the table above” -Credential $Cred

This is all, now let’s check
Get-CrmInstance -Id “Your Dynamics CRM Instance ID (GUID)” -ApiUrl
Your Service URL from the table above -Credential $cred

Hope it helps

Leave a Reply

Your email address will not be published. Required fields are marked *

Kontrol / Control * Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.