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!

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.

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.

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

4 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!

    Reply
  • 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.

    Reply
  • 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?

    Reply
    • Any update on this?
      I have version 3.4.0 installed but the ‘ExchangeOnlineManagement’-module indeed does not have the Get-UnifiedGroup Cmdlet. I checked this using ‘Get-Command -Module ExchangeOnlineManagement’

      Get-Command -Module ExchangeOnlineManagement

      CommandType Name Version Source
      ———– —- ——- ——
      Function Connect-ExchangeOnline 3.4.0 ExchangeOnlineManagement
      Function Connect-IPPSSession 3.4.0 ExchangeOnlineManagement
      Function Disconnect-ExchangeOnline 3.4.0 ExchangeOnlineManagement
      ……

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *