From 2f88ed030413b95c358c35673918ed020a023efd Mon Sep 17 00:00:00 2001 From: 0x3e5f3c3b Date: Tue, 21 May 2024 11:09:43 +1000 Subject: [PATCH] Update manage-creation-of-groups.md Added the '-All' flag to 'Get-MgBetaGroup' command on line 140 of the file. 'Get-MgBetaGroup' only returns the first 100 results. This means the script does not work properly in environments with over 100 groups. Adding the '-All' flag to 'Get-MgBetaGroup' allows the command to return all results, allowing the script to work properly in environments with a large volume of groups. --- microsoft-365/solutions/manage-creation-of-groups.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsoft-365/solutions/manage-creation-of-groups.md b/microsoft-365/solutions/manage-creation-of-groups.md index 81cf4298f77..f40e7dec566 100644 --- a/microsoft-365/solutions/manage-creation-of-groups.md +++ b/microsoft-365/solutions/manage-creation-of-groups.md @@ -137,7 +137,7 @@ if(!$settingsObjectID) } -$groupId = (Get-MgBetaGroup | Where-object {$_.displayname -eq $GroupName}).Id +$groupId = (Get-MgBetaGroup -All | Where-object {$_.displayname -eq $GroupName}).Id $params = @{ templateId = "62375ab9-6b52-47ed-826b-58e47e0e304b"