Get-UnifiedGroup : The term ‘Get-UnifiedGroup’ is not recognized as the name of a cmdlet, function, script file, or operable program.
Problem: Getting “Get-UnifiedGroup : The term ‘Get-UnifiedGroup’ 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.” error in PowerShell!
Root Cause and Solution:
You must connect to Exchange Online, Before using the Get-UnifiedGroup or Set-UnifiedGroup cmdlet that interacts with Microsoft 365 groups.
Solution 1: Install the Exchange Online PowerShell Module!
The Get-UnifiedGroup cmdlet is part of the Exchange Management module, and it may not be installed in your system! So, to resolve the problem, You have to install the Exchange Online Module for PowerShell and connect to Exchange Online first.
#Install Exchange Online Management Shell Install-Module -Name ExchangeOnlineManagement #Connect to Exchange Online Connect-ExchangeOnline #Run Get-UnifiedGroup Get-UnifiedGroup
Solution 2: Create and Import a PSSession
Without the Exchange Online Management Module, You can connect to Exchange Online using PSSession. However, the PSSession method will be deprecated soon.
$Credential = Get-Credential #Create the session $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ ` -Credential $Credential -Authentication Basic -AllowRedirection #Import the session Import-PSSession $Session -DisableNameChecking #Get all Office 365 Group Get-UnifiedGroup
A similar solution applies to “set-unifiedgroup is not a recognized cmdlet” error as well.
3 thoughts on “Get-UnifiedGroup : The term ‘Get-UnifiedGroup’ is not recognized as the name of a cmdlet, function, script file, or operable program.”
As someone who is not well-versed in PowerShell or Microsoft 365 groups, I found this article informative and helpful in understanding a common error message that can occur when using certain cmdlets. The author provides two solutions to the problem, including installing the Exchange Online PowerShell module and creating/importing a PSSession. It’s great that the author explains the root cause of the error and provides step-by-step instructions on how to resolve it. I also appreciate the author’s mention of the upcoming deprecation of the PSSession method. Overall, this article is well-written and easy to follow for those who may be experiencing this issue. Thank you, Salaudeen Rajack, for sharing your knowledge!
Thank you for sharing this solution to the “Get-UnifiedGroup : The term ‘Get-UnifiedGroup’ is not recognized as the name of a cmdlet, function, script file, or operable program” error in PowerShell. It’s very helpful to have step-by-step instructions on how to install the Exchange Online Management Shell and connect to Exchange Online to resolve the issue.
I do have a question, though. Is there any way to resolve this issue without installing the Exchange Online PowerShell Module? I’m hesitant to install new modules on my system if there’s an alternative solution available.
Have the exact same issue but solution 1 does not solve it, since the Get-UnifiedGroup Cmdlet is not in the module.
Even after updating the module shows version 3.1.0. Is there a newer one? Do I need to use version 2?