Using Get-OrganizationConfig in Powershell

Using Get-OrganizationConfig in Powershell

Using the Get-OrganizationConfig cmdlet in PowerShell is a key tool for Exchange administrators who need to get a clear picture of their organization's current setup.

Whether you’re managing an on-premises Exchange environment or a hybrid setup with Exchange Online, this command gives you access to a wide range of configuration details that are essential for maintaining, auditing, and troubleshooting your system.

Today we’ll learn how to effectively use Get-OrganizationConfig, with practical examples and tips to ensure you’re getting the most out of this powerful command.

What is the Get-OrganizationConfig Command in PowerShell?

The Get-OrganizationConfig cmdlet is used to view the configuration settings of an Exchange organization in PowerShell.

It retrieves a wide range of information about the organization's setup, including policies, limits, and other key settings that impact how the organization operates within Exchange.

This command is highly useful for administrators reviewing or auditing the current configuration to ensure alignment with organizational policies or for troubleshooting issues related to email flow, compliance, or user management.

Here’s the syntax of the Get-OrganizationConfig command and the meaning of its two main parameters:

Get-OrganizationConfig

[-DomainController <Fqdn>]

[<CommonParameters>]

  • -DomainController <Fqdn>: Specifies the fully qualified domain name (FQDN) of the domain controller that should be used to retrieve the organization's configuration data.
  • <CommonParameters>: Refers to a set of standard parameters available in all PowerShell cmdlets, such as -Verbose, -Debug, -ErrorAction, and others, that control the behavior of the cmdlet.

3 Case Uses for the 'Get-OrganizationConfig' Command

Although the Get-OrganizationConfig PowerShell cmdlet is pretty straightforward, there are a few things you can use it for, such as these three scenarios:

  1. Compliance Audits: Administrators can use Get-OrganizationConfig to review settings related to data retention, mail flow rules, and security policies, ensuring the organization complies with legal and regulatory requirements.
  2. Troubleshooting Mail Flow Issues: If users experience problems with email delivery or unexpected email handling behavior, running this command can help identify misconfigurations or inconsistencies in the organization's setup that may be causing the issues.
  3. Planning Configuration Changes: Before making significant changes to the organization’s Exchange environment, such as implementing new policies or modifying existing ones, Get-OrganizationConfig provides a snapshot of current settings.

Prerequisites to Use the Get-OrganizationConfig Cmdlet

The key to using this command successfully is to have all the permissions you need, meaning you have to comply with these 3 prerequisites:

  1. Assigned Permissions: You need to have the appropriate permissions assigned to you within the Exchange environment to run the Get-OrganizationConfig cmdlet.
  2. Access to Specific Parameters: Even if you can run the cmdlet, access to certain parameters might be restricted based on the permissions granted to your role.
  3. Exchange Management Environment: You need to be in an Exchange Management environment or have access to Exchange Management tools where the cmdlet can be executed.

3 Steps to Use Get-OrganizationConfig in PowerShell

Follow these three steps to successfully execute Get-OrganizationConfig in PowerShell.

Step 1: Connect to Exchange Online PowerShell

First, ensure you're connected to the correct Exchange platform: use Exchange Management Shell for on-premises systems, or Exchange Online PowerShell for cloud environments. Open PowerShell with admin rights and run:

Connect-ExchangeOnline -UserPrincipalName [email protected]


You'll be asked to log in with your credentials to proceed.

Step 2: Verify Permissions and Access

Before running the Get-OrganizationConfig cmdlet, ensure that your user account has the necessary permissions.

You will generally need a role that includes the "Organization Management" or "View-Only Organization Management" role group.

You can verify your permissions in the Exchange Admin Center (EAC) or by running the Get-ManagementRoleAssignment cmdlet in PowerShell to check your current role assignments.

Step 3: Execute the Get-OrganizationConfig Command

Once you’re in the Exchange Management Shell, you can execute the Get-OrganizationConfig cmdlet. Simply type Get-OrganizationConfig and press Enter, like this:

Get-OrganizationConfig


This will output all the configuration settings of the Exchange organization to the console. If you need to filter or export this information, you can use additional parameters or pipeline the output to other cmdlets.

Take a look at this example:

Get-OrganizationConfig -DomainController MeetingRoomSC

This command retrieves the configuration settings for the entire Exchange organization from the specified domain controller, "MeetingRoomSC."

Here’s another example:

Get-OrganizationConfig | Export-CliXML C:\Data\MeetingRooms.xml

This cmdlet retrieves the configuration settings for the entire Exchange organization and exports them as a CLI XML file to the specified path C:\Data\MeetingRooms.xml.

How to Fix the "Get-OrganizationConfig is not Recognized" Error Message

Now, it’s possible that you encounter an error when trying to run this command, as pointed out on the official Microsoft website.

When you encounter the error "Get-OrganizationConfig is not recognized" while running the Hybrid Configuration wizard, it means that the wizard can't complete because your Microsoft 365 subscription lacks access to specific cmdlets required for hybrid deployment.

There are a few things that might cause this:

  • Subscription Limitation: Your current Microsoft 365 plan doesn’t include the necessary permissions or access to certain cmdlets, such as Get-HybridMailflowDatacenterIPs, that the Hybrid Configuration wizard depends on.
  • Cmdlet Unavailability: The specific cmdlets needed for the hybrid setup aren’t available because they are tied to a higher-tier subscription plan.

To fix this issue, you can work around the limitation by adding an Office 365 E3 trial subscription, which provides access to the necessary cmdlets. Let’s follow the steps recommended by Microsoft:

  • Sign in to the Microsoft 365 Portal: Log in to the Microsoft 365 portal using your administrator credentials.
  • Access the Subscriptions Page: In the admin center, go to the Billing section, and select Subscriptions.
  • Add the Office 365 E3 Trial: Click on New Subscription, find the Office 365 Enterprise E3 plan, and choose the trial option. Follow the instructions provided to activate the trial.

After adding the E3 trial, run the Hybrid Configuration wizard again. This should resolve the issue by allowing the wizard to access the necessary cmdlets and complete successfully. If problems persist, you may need to reach out to Microsoft Support for additional help.

Summary: Using Get-OrganizationConfig in PowerShell

The Get-OrganizationConfig cmdlet is an essential tool for any Exchange administrator seeking to effectively manage and maintain their organization's configuration. Let’s make a quick recap of the info we have discussed so far:

  • The Get-OrganizationConfig cmdlet provides detailed insights into your Exchange organization's configuration, helping you stay on top of important settings and policies.
  • Regular use of this command can assist in auditing and adjusting your environment, making sure everything runs smoothly and in line with organizational needs.
  • If you encounter the "Get-OrganizationConfig is not recognized" error, it may be due to subscription limitations, which can be resolved by adding an appropriate Microsoft 365 plan or contacting support for assistance.