Skip to content

Commit c59b130

Browse files
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into dev
2 parents 3777ac2 + cad96bb commit c59b130

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

Modules/CIPPCore/Public/New-CIPPGroup.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,18 @@ function New-CIPPGroup {
275275
}
276276

277277
$GraphRequest = New-ExoRequest -tenantid $TenantFilter -cmdlet 'New-DistributionGroup' -cmdParams $ExoParams
278+
279+
$Aliases = @($GroupObject.aliases -split '\r?\n' | ForEach-Object { $_.Trim() } | Where-Object { $_ })
280+
$SetParams = @{ Identity = $GraphRequest.Identity }
281+
if ($GroupObject.hideFromGAL) {
282+
$SetParams.HiddenFromAddressListsEnabled = $true
283+
}
284+
if ($Aliases.Count -gt 0) {
285+
$SetParams.EmailAddresses = @{ '@odata.type' = '#Exchange.GenericHashTable'; Add = @($Aliases | ForEach-Object { "smtp:$_" }) }
286+
}
287+
if ($SetParams.Keys.Count -gt 1) {
288+
$null = New-ExoRequest -tenantid $TenantFilter -cmdlet 'Set-DistributionGroup' -cmdParams $SetParams
289+
}
278290
}
279291

280292
$Result = [PSCustomObject]@{

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/Identity/Administration/Groups/Invoke-AddGroupTemplate.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ function Invoke-AddGroupTemplate {
5353
allowExternal = $Request.Body.allowExternal
5454
username = $Request.Body.username # Can contain variables like @%tenantfilter%
5555
licenses = $Request.Body.licenses
56+
aliases = $Request.Body.aliases # One per line, variables allowed
57+
hideFromGAL = $Request.Body.hideFromGAL
5658
GUID = $GUID
5759
} | ConvertTo-Json -Depth 10
5860
$Table = Get-CippTable -tablename 'templates'

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/Identity/Administration/Groups/Invoke-ListGroupTemplates.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ function Invoke-ListGroupTemplates {
4848
allowExternal = $data.allowExternal
4949
username = $data.username
5050
licenses = $data.licenses
51+
aliases = $data.aliases
52+
hideFromGAL = $data.hideFromGAL
5153
GUID = $_.RowKey
5254
source = $_.Source
5355
isSynced = (![string]::IsNullOrEmpty($_.SHA))

0 commit comments

Comments
 (0)