In this blog I will share How to Fix “Get-DistributionGroup : The term ‘Get-DistributionGroup’ is not recognized as the name of a cmdlet, function, script file, or operable program.” error.
This command is available on Exchange on-premise and Exchange online setup.
Both the setup has similar requirements that needs to be fulfilled to be able to run the command without the error:
For Exchange on premise Setup, check the below:
For Exchange On-premise PowerShell commands, we will have to make sure that we run the commands in the Exchange Management Shell.
Exchange Management Shell is only available on your Windows Server on which you have Exchange server installed.
Make sure you are on the right Windows server and then run the Get-DistributionGroup command in the Exchange management shell.
You can find the syntax of the command at the last section of the blog and you can use the supported parameter which is required, as per your need.
It should be able to run the command successfully without giving you the same error.
For Exchange Online Setup, check the below:
For Distribution group which are in Exchange online, we can get the error if we run the command in the Windows PowerShell which is not connected to exchange online.
Open your windows PowerShell as an Administrator on your computer and then connect it to Exchange online using this article.
Once connected, you should be able to run the Get-DistributionGroup command in the PowerShell window.
Below is the syntax of the command:
Get-DistributionGroup
[-Anr ]
[-Credential ]
[-DomainController ]
[-Filter ]
[-IgnoreDefaultScope]
[-IncludeAcceptMessagesOnlyFromDLMembersWithDisplayNames]
[-IncludeAcceptMessagesOnlyFromSendersOrMembersWithDisplayNames]
[-IncludeAcceptMessagesOnlyFromWithDisplayNames]
[-OrganizationalUnit ]
[-ReadFromDomainController]
[-RecipientTypeDetails ]
[-ResultSize ]
[-SortBy ]
Example for the above command:
Get-DistributionGroup -Identity "Group Name" | FL
Above “Group Name” is the name of the Distribution group of which I want to get current settings.
If I Run the command on my Distribution list named Group gd, I get the Output below:
The output shows the details of the distribution group.
To know more about the command Get-DistributionGroup, refer Microsoft Official article.
Do let me know if you have any question, in the comment section below.
Date:23/02/2024
Author: Prem
Tag: Get-DistributionGroup : The term ‘Get-DistributionGroup’ is not recognized as the name of a cmdlet, function, script file, or operable program