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 cmdlet that gets all 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 fix 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

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply