Skip to content

Commit 033b295

Browse files
authored
Update manage-creation-of-groups.md
Add "-All" to all Get Commands
1 parent 4d2dcbb commit 033b295

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

microsoft-365/solutions/manage-creation-of-groups.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Connect-MgGraph -Scopes "Directory.ReadWrite.All", "Group.Read.All"
117117
$GroupName = ""
118118
$AllowGroupCreation = "False"
119119
120-
$settingsObjectID = (Get-MgBetaDirectorySetting | Where-object -Property Displayname -Value "Group.Unified" -EQ).id
120+
$settingsObjectID = (Get-MgBetaDirectorySetting -All | Where-object -Property Displayname -Value "Group.Unified" -EQ).id
121121
122122
if(!$settingsObjectID)
123123
{
@@ -133,11 +133,11 @@ if(!$settingsObjectID)
133133
134134
New-MgBetaDirectorySetting -BodyParameter $params
135135
136-
$settingsObjectID = (Get-MgBetaDirectorySetting | Where-object -Property Displayname -Value "Group.Unified" -EQ).Id
136+
$settingsObjectID = (Get-MgBetaDirectorySetting -All | Where-object -Property Displayname -Value "Group.Unified" -EQ).Id
137137
}
138138
139139
140-
$groupId = (Get-MgBetaGroup | Where-object {$_.displayname -eq $GroupName}).Id
140+
$groupId = (Get-MgBetaGroup -All | Where-object {$_.displayname -eq $GroupName}).Id
141141
142142
$params = @{
143143
templateId = "62375ab9-6b52-47ed-826b-58e47e0e304b"

0 commit comments

Comments
 (0)