Hi Everyone this is Prem, I have worked as Microsoft 365 support ambassador. In this blog I will share How to Fix Get-Distributiongroupmember not Recognized error.
This command is available on Exchange online and Exchange on-premise.
So depending on where you want to run the command you will have to make sure you met the requirement.
If your Distribution group of which you want to get a list of members, is either in Exchange online or Exchange on premise, just make sure the PowerShell on which you are running is meeting the requirements.
For a Distribution group of which you want to retrieve members of, is in Exchange Online, this Get-Distributiongroupmember not Recognized error occurs, when we run the command in the Windows PowerShell which is not connected to exchange online.
If its not connected correctly you will get error like this:
Get-Distributiongroupmember not Recognized error in Exchange On-Premise:
For a Distribution group which is on your On-premise Exchange server, this error can occur when you run this command on a Windows PowerShell and not on the Exchange management Shell.For Exchange On-premise PowerShell commands, we will have to make sure that we run the commands in the Exchange Management Shell and not the Windows PowerShell.Exchange Management Shell is only available on your the Windows Server on which you have Exchange server installed.Make sure you are on the right server and then run the Get-Distributiongroupmember command in the Exchange management shell.You can find the syntax of the command below and 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 Get-Distributiongroupmember not Recognized error.
Get-Distributiongroupmember not Recognized in Exchange Online: