skip to Main Content

The term Get-OrganizationConfig is not recognized

You want to run the Hybrid Configuration Wizard because you need to push some changes to Office 365. When going through the wizard and connecting to Office 365, the following error appears: Command not recognized. Please verify you have the correct Management Role assigned to your account. What is happening, and what is the solution?

Please verify you have the correct Management Role assigned to your account

Run the Hybrid Configuration Wizard and go through the steps. Once we are at the screen to fill in the on-premises Exchange administrator account credentials and the Office 365 tenant administrator account, we click on next.

Get-OrganizationConfig not recognized accounts

It will gather both accounts’ information and connect to Exchange on-premises and Exchange Online. However, it connects successfully to Exchange on-premises but not to Office 365.

The error shows:

Command not recognized. Please verify you have the correct Management Role assigned to your account.

Get-OrganizationConfig not recognized error

Check Exchange Hybrid Configuration logs

Let’s look at the Exchange Hybrid Configuration logs.

Start File Explorer and go to the location:

%UserProfile%\AppData\Roaming\Microsoft\Exchange Hybrid Configuration

Sort on Date modified.

Get-OrganizationConfig not recognized log

Open the log with the last modified date and scroll down to the bottom.

Get-OrganizationConfig not recognized log error

The text in the log is difficult to see but copied and shown below.

2022.07.31 07:58:27.136         10084 [Client=UX, Activity=Tenant Connection Validation, Thread=11] Getting configuration data...
2022.07.31 07:58:27.246         10258 [Client=UX, Activity=Tenant Data Retrieval, Thread=11] START 
2022.07.31 07:58:27.247         10276 [Client=UX, Activity=Tenant Connection Validation, Session=Tenant, Cmdlet=Get-OrganizationConfig, Thread=11] START 
2022.07.31 07:58:27.947 *ERROR* 10277 [Client=UX, Activity=Tenant Connection Validation, Session=Tenant, Cmdlet=Get-OrganizationConfig, Thread=11] FINISH Time=700,0ms Results=Command not recognized.  Please verify you have the correct Management Role assigned to your account.
2022.07.31 07:58:27.947 *ERROR* 10085 [Client=UX, Activity=Tenant Connection Validation, Thread=11] Command not recognized.  Please verify you have the correct Management Role assigned to your account.
2022.07.31 07:58:27.948         10084 [Client=UX, Activity=Tenant Connection Validation, Thread=11] Command not recognized.  Please verify you have the correct Management Role assigned to your account.
2022.07.31 07:58:27.949         10275 [Client=UX, Activity=Tenant Connection Validation, Thread=11] FINISH Time=4267,0ms
2022.07.31 07:58:27.949 WARNING 10079 [Client=UX, Activity=Tenant Connection Validation, Thread=11] Command not recognized.  Please verify you have the correct Management Role assigned to your account.

The error shows that the Hybrid Configuration Wizard did run the Get-OrganizationConfig cmdlet in the cloud. But, the command is not recognized.

Get-OrganizationConfig command not recognized

Let’s reproduce the above error and see if we get the same error when we run the command manually in Exchange Online.

Start Windows PowerShell as administrator and connect to Exchange Online PowerShell.

PS C:\> Connect-ExchangeOnline

Run the Get-OrganizationConfig cmdlet.

PS C:\> Get-OrganizationConfig

The output shows that the term Get-OrganizationConfig is not recognized as the name of a cmdlet, function, script file, or operable program

Get-OrganizationConfig : The term 'Get-OrganizationConfig' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
+ Get-OrganizationConfig
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-OrganizationConfig:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Solution to Get-OrganizationConfig command not recognized

Now that we cannot run the Get-OrganizationConfig cmdlet, let’s look at the solution and add the admin account to the Compliance Management group.

Assign account to Compliance Management role with PowerShell

To assign the admin account to the Compliance Management role group with PowerShell, run the Update-RoleGroupMember cmdlet.

PS C:\> Update-RoleGroupMember -Identity "Compliance Management" -Members "admin@exoip365.onmicrosoft.com"

Assign account to Compliance Management role in Microsoft 365 admin center

To assign the admin account to the Compliance Management role group in Microsoft 365 admin center, follow these steps:

  • Sign in to Microsoft 365 admin center
  • Expand Roles and click on Role assignments
  • Click on Exchange in the top bar
  • Choose Compliance Management from the list
Get-OrganizationConfig not recognized role assignments
  • Click on Assigned in the top bar
  • Add the admin account
Get-OrganizationConfig not recognized compliance management

Verify Get-OrganizationConfig works

Let’s verify that the Get-OrganizationConfig cmdlet works. After that, rerun the Hybrid Configuration Wizard and check that it connects successfully.

Note: Wait an hour before you try and run the Get-OrganizationConfig cmdlet. That’s because it takes time to populate the changes in Microsoft’s cloud servers.

1. Run the Disconnect-ExchangeOnline cmdlet and close the PowerShell window.

PS C:\> Disconnect-ExchangeOnline

2. Start Windows PowerShell as administrator and connect to Exchange Online.

3. Run the Get-OrganizationConfig cmdlet.

PS C:\> Get-OrganizationConfig

This time it’s a success and outputs the Exchange Online organization configuration data.

4. Close the Hybrid Configuration Wizard and run it again.

Hybrid Configuration Wizard succeeded

This time it will succeed when connecting to Office 365 with the admin account credentials.

Read more: Hybrid Configuration Wizard fails to connect »

Conclusion

You learned why the command Get-OrganizationConfig is not recognized. The solution to this problem is adding the admin account to the Compliance Management role group. After that, you can run the command Get-OrganizationConfig in PowerShell and get the information or rerun the Hybrid Configuration Wizard and proceed further.

Did you enjoy this article? You may also like Export results errors in Content Search. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 0 Comments

Leave a Reply

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