It's good to go through the Exchange Hybrid test plan checklist and test all the…
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?
Table of contents
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.
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.
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.
Open the log with the last modified date and scroll down to the bottom.
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
- Click on Assigned in the top bar
- Add the admin account
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 PowerShell.
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.
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.
This Post Has 0 Comments