Skip to content

Commit e01191f

Browse files
authored
Merge pull request #284 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 52aa7b1 + 8ebf9cc commit e01191f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Email-Exchange/Transport/Invoke-AddTransportRule.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using namespace System.Net
22

3-
Function Invoke-AddTransportRule {
3+
function Invoke-AddTransportRule {
44
<#
55
.FUNCTIONALITY
6-
Entrypoint
6+
Entrypoint,AnyTenant
77
.ROLE
88
Exchange.TransportRule.ReadWrite
99
#>
@@ -17,6 +17,15 @@ Function Invoke-AddTransportRule {
1717
$RequestParams = $Request.Body.PowerShellCommand | ConvertFrom-Json | Select-Object -Property * -ExcludeProperty GUID, HasSenderOverride, ExceptIfHasSenderOverride, ExceptIfMessageContainsDataClassifications, MessageContainsDataClassifications
1818

1919
$Tenants = ($Request.body.selectedTenants).value
20+
21+
$AllowedTenants = Test-CippAccess -Request $Request -TenantList
22+
23+
if ($AllowedTenants -ne 'AllTenants') {
24+
$AllTenants = Get-Tenants -IncludeErrors
25+
$AllowedTenantList = $AllTenants | Where-Object { $_.customerId -in $AllowedTenants }
26+
$Tenants = $Tenants | Where-Object { $_ -in $AllowedTenantList.defaultDomainName }
27+
}
28+
2029
$Result = foreach ($tenantFilter in $tenants) {
2130
$Existing = New-ExoRequest -ErrorAction SilentlyContinue -tenantid $tenantFilter -cmdlet 'Get-TransportRule' -useSystemMailbox $true | Where-Object -Property Identity -EQ $RequestParams.name
2231
try {

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-AddStandardsTemplate.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ function Invoke-AddStandardsTemplate {
2929
RowKey = "$GUID"
3030
PartitionKey = 'StandardsTemplateV2'
3131
GUID = "$GUID"
32-
3332
}
34-
Write-LogMessage -headers $Request.Headers -API $APINAME -message "Created CA Template $($Request.body.name) with GUID $GUID" -Sev 'Debug'
33+
Write-LogMessage -headers $Request.Headers -API $APINAME -message "Standards Template $($Request.body.templateName) with GUID $GUID added/edited." -Sev 'Info'
3534
$body = [pscustomobject]@{'Results' = 'Successfully added template'; Metadata = @{id = $GUID } }
3635

3736
# Associate values to output bindings by calling 'Push-OutputBinding'.

0 commit comments

Comments
 (0)