Skip to content

Commit 108b7c7

Browse files
authored
Merge pull request #264 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents d5fd5a8 + 85181ac commit 108b7c7

File tree

8 files changed

+24
-15
lines changed

8 files changed

+24
-15
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Email-Exchange/Transport/Invoke-AddExConnector.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-AddExConnector {
3+
function Invoke-AddExConnector {
44
<#
55
.FUNCTIONALITY
6-
Entrypoint
6+
Entrypoint,AnyTenant
77
.ROLE
88
Exchange.Connector.ReadWrite
99
#>
@@ -19,6 +19,15 @@ Function Invoke-AddExConnector {
1919
$RequestParams = $Request.Body.PowerShellCommand | ConvertFrom-Json | Select-Object -Property * -ExcludeProperty GUID, cippConnectorType, SenderRewritingEnabled
2020
if ($RequestParams.comment) { $RequestParams.comment = Get-CIPPTextReplacement -Text $RequestParams.comment -TenantFilter $Tenant } else { $RequestParams | Add-Member -NotePropertyValue 'no comment' -NotePropertyName comment -Force }
2121
$Tenants = ($Request.Body.selectedTenants).value
22+
23+
$AllowedTenants = Test-CippAccess -Request $Request -TenantList
24+
25+
if ($AllowedTenants -ne 'AllTenants') {
26+
$AllTenants = Get-Tenants -IncludeErrors
27+
$AllowedTenantList = $AllTenants | Where-Object { $_.customerId -in $AllowedTenants }
28+
$Tenants = $Tenants | Where-Object { $_ -in $AllowedTenantList.defaultDomainName }
29+
}
30+
2231
$Result = foreach ($TenantFilter in $Tenants) {
2332
try {
2433
$null = New-ExoRequest -tenantid $TenantFilter -cmdlet "New-$($ConnectorType)connector" -cmdParams $RequestParams

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Conditional/Invoke-AddNamedLocation.ps1

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

3-
Function Invoke-AddNamedLocation {
3+
function Invoke-AddNamedLocation {
44
<#
55
.FUNCTIONALITY
6-
Entrypoint
6+
Entrypoint,AnyTenant
77
.ROLE
88
Tenant.ConditionalAccess.ReadWrite
99
#>

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Conditional/Invoke-ExecNamedLocation.ps1

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

3-
Function Invoke-ExecNamedLocation {
3+
function Invoke-ExecNamedLocation {
44
<#
55
.FUNCTIONALITY
6-
Entrypoint
6+
Entrypoint,AnyTenant
77
.ROLE
88
Tenant.ConditionalAccess.ReadWrite
99
#>

Modules/CIPPCore/Public/GraphHelper/Write-AlertMessage.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function Write-AlertMessage($message, $tenant = 'None', $tenantId = $null) {
1010
$ExistingMessage = Get-CIPPAzDataTableEntity @Table -Filter $Filter
1111
if (!$ExistingMessage) {
1212
Write-Host 'No duplicate message found, writing to log'
13-
Write-LogMessage -message $message -tenant $tenant -sev 'Alert' -tenantId $tenantId -Headers'CIPP' -API 'Alerts'
13+
Write-LogMessage -message $message -tenant $tenant -sev 'Alert' -tenantId $tenantId -API 'Alerts'
1414
} else {
1515
Write-Host 'Alerts: Duplicate entry found, not writing to log'
1616

Modules/CippExtensions/Public/NinjaOne/Invoke-NinjaOneDeviceWebhook.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function Invoke-NinjaOneDeviceWebhook {
2828
$Token = Get-NinjaOneToken -configuration $Configuration
2929

3030
if (!$Token.access_token) {
31-
Write-LogMessage -API 'NinjaOneSync' -tenant $tenantfilter -Headers'CIPP' -message 'Failed to get NinjaOne Token for Device Compliance Update' -Sev 'Error'
31+
Write-LogMessage -API 'NinjaOneSync' -tenant $tenantfilter -message 'Failed to get NinjaOne Token for Device Compliance Update' -Sev 'Error'
3232
return
3333
}
3434

@@ -52,10 +52,10 @@ function Invoke-NinjaOneDeviceWebhook {
5252
$_.Exception.message
5353
}
5454
Write-Error "Failed NinjaOne Device Webhook for: $($Data | ConvertTo-Json -Depth 100) Linenumber: $($_.InvocationInfo.ScriptLineNumber) Error: $Message"
55-
Write-LogMessage -API 'NinjaOneSync' -Headers'CIPP' -message "Failed NinjaOne Device Webhook Linenumber: $($_.InvocationInfo.ScriptLineNumber) Error: $Message" -Sev 'Error'
55+
Write-LogMessage -API 'NinjaOneSync' -message "Failed NinjaOne Device Webhook Linenumber: $($_.InvocationInfo.ScriptLineNumber) Error: $Message" -Sev 'Error'
5656
}
5757
} else {
58-
Write-LogMessage -API 'NinjaOneSync' -Headers'CIPP' -message "$($DeviceM365.displayName) ($($M365DeviceID)) was not matched in Ninja for $($tenantfilter)" -Sev 'Info'
58+
Write-LogMessage -API 'NinjaOneSync' -message "$($DeviceM365.displayName) ($($M365DeviceID)) was not matched in Ninja for $($tenantfilter)" -Sev 'Info'
5959
}
6060

6161
}
@@ -67,7 +67,7 @@ function Invoke-NinjaOneDeviceWebhook {
6767
$_.Exception.message
6868
}
6969
Write-Error "Failed NinjaOne Device Webhook for: $($Data | ConvertTo-Json -Depth 100) Linenumber: $($_.InvocationInfo.ScriptLineNumber) Error: $Message"
70-
Write-LogMessage -API 'NinjaOneSync' -Headers'CIPP' -message "Failed NinjaOne Device Webhook Linenumber: $($_.InvocationInfo.ScriptLineNumber) Error: $Message" -Sev 'Error'
70+
Write-LogMessage -API 'NinjaOneSync' -message "Failed NinjaOne Device Webhook Linenumber: $($_.InvocationInfo.ScriptLineNumber) Error: $Message" -Sev 'Error'
7171
}
7272

7373

Modules/CippExtensions/Public/NinjaOne/Invoke-NinjaOneExtensionScheduler.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function Invoke-NinjaOneExtensionScheduler {
5959
}
6060
Add-AzDataTableEntity @Table -Entity $AddObject -Force
6161

62-
Write-LogMessage -API 'NinjaOneSync' -Headers'CIPP' -message "NinjaOne Daily Synchronization Queued for $(($TenantsToProcess | Measure-Object).count) Tenants" -Sev 'Info'
62+
Write-LogMessage -API 'NinjaOneSync' -message "NinjaOne Daily Synchronization Queued for $(($TenantsToProcess | Measure-Object).count) Tenants" -Sev 'Info'
6363

6464
} else {
6565
if ($LastRunTime -lt (Get-Date).AddMinutes(-90)) {
@@ -95,7 +95,7 @@ function Invoke-NinjaOneExtensionScheduler {
9595
}
9696

9797
if (($CatchupTenants | Measure-Object).count -gt 0) {
98-
Write-LogMessage -API 'NinjaOneSync' -Headers'CIPP' -message "NinjaOne Synchronization Catchup Queued for $(($CatchupTenants | Measure-Object).count) Tenants" -Sev 'Info'
98+
Write-LogMessage -API 'NinjaOneSync' -message "NinjaOne Synchronization Catchup Queued for $(($CatchupTenants | Measure-Object).count) Tenants" -Sev 'Info'
9999
}
100100

101101
}

Modules/CippExtensions/Public/NinjaOne/Invoke-NinjaOneOrgMapping.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function Invoke-NinjaOneOrgMapping {
8787
IntegrationName = "$($MatchedOrg.name)"
8888
}
8989
Add-AzDataTableEntity @CIPPMapping -Entity $AddObject -Force
90-
Write-LogMessage -API 'NinjaOneAutoMap_Queue' -Headers'CIPP' -message "Added mapping from Organization name match for $($Tenant.customerId). to $($($MatchedOrg.name))" -Sev 'Info'
90+
Write-LogMessage -API 'NinjaOneAutoMap_Queue' -message "Added mapping from Organization name match for $($Tenant.customerId). to $($($MatchedOrg.name))" -Sev 'Info'
9191
}
9292
}
9393

Modules/CippExtensions/Public/NinjaOne/Invoke-NinjaOneOrgMappingTenant.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function Invoke-NinjaOneOrgMappingTenant {
6666
IntegrationName = "$($MatchedOrg.name)"
6767
}
6868
Add-AzDataTableEntity @CIPPMapping -Entity $AddObject -Force
69-
Write-LogMessage -API 'NinjaOneAutoMap_Queue' -Headers'CIPP' -message "Added mapping from Device match for $($Tenant.displayName) to $($($MatchedOrg.name))" -Sev 'Info'
69+
Write-LogMessage -API 'NinjaOneAutoMap_Queue' -message "Added mapping from Device match for $($Tenant.displayName) to $($($MatchedOrg.name))" -Sev 'Info'
7070

7171
}
7272

0 commit comments

Comments
 (0)