@@ -30,7 +30,7 @@ function Invoke-CIPPStandardGroupTemplate {
3030 param ($Tenant , $Settings )
3131 # #$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'GroupTemplate'
3232
33- If ($Settings.remediate -eq $true ) {
33+ if ($Settings.remediate -eq $true ) {
3434 # Because the list name changed from TemplateList to groupTemplate by someone :@, we'll need to set it back to TemplateList
3535 $Settings.groupTemplate ? ($Settings | Add-Member - NotePropertyName ' TemplateList' - NotePropertyValue $Settings.groupTemplate ) : $null
3636 Write-Host " Settings: $ ( $Settings.TemplateList | ConvertTo-Json ) "
@@ -42,11 +42,11 @@ function Invoke-CIPPStandardGroupTemplate {
4242 $email = if ($groupobj.domain ) { " $ ( $groupobj.username ) @$ ( $groupobj.domain ) " } else { " $ ( $groupobj.username ) @$ ( $Tenant ) " }
4343 $CheckExististing = New-GraphGETRequest - uri ' https://graph.microsoft.com/beta/groups?$top=999' - tenantid $tenant | Where-Object - Property displayName -EQ $groupobj.displayname
4444 $BodyToship = [pscustomobject ] @ {
45- ' displayName' = $groupobj.Displayname
46- ' description' = $groupobj.Description
47- ' mailNickname' = $groupobj.username
48- mailEnabled = [bool ]$false
49- securityEnabled = [bool ]$true
45+ ' displayName' = $groupobj.Displayname
46+ ' description' = $groupobj.Description
47+ ' mailNickname' = $groupobj.username
48+ mailEnabled = [bool ]$false
49+ securityEnabled = [bool ]$true
5050 }
5151 if ($groupobj.groupType -eq ' AzureRole' ) {
5252 $BodyToship | Add-Member - NotePropertyName ' isAssignableToRole' - NotePropertyValue $true
@@ -58,7 +58,7 @@ function Invoke-CIPPStandardGroupTemplate {
5858 }
5959 if (! $CheckExististing ) {
6060 $ActionType = ' create'
61- if ($groupobj.groupType -in ' Generic' , ' azurerole' , ' dynamic' ) {
61+ if ($groupobj.groupType -in ' Generic' , ' azurerole' , ' dynamic' , ' Security ' ) {
6262 $GraphRequest = New-GraphPostRequest - uri ' https://graph.microsoft.com/beta/groups' - tenantid $tenant - type POST - body (ConvertTo-Json - InputObject $BodyToship - Depth 10 ) - verbose
6363 } else {
6464 if ($groupobj.groupType -eq ' dynamicdistribution' ) {
0 commit comments