Skip to content

Commit 07a61cb

Browse files
authored
Merge pull request #628 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents b3f2201 + 1d4bfad commit 07a61cb

File tree

6 files changed

+24
-29
lines changed

6 files changed

+24
-29
lines changed

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertGlobalAdminAllowList.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ function Get-CIPPAlertGlobalAdminAllowList {
4646
$UpnPrefix = ($admin.userPrincipalName -split '@')[0].ToLowerInvariant()
4747
if ($AllowedLookup -notcontains $UpnPrefix) {
4848
[PSCustomObject]@{
49-
Admin = $admin
50-
UpnPrefix = $UpnPrefix
49+
Admin = $admin
50+
UpnPrefix = $UpnPrefix
5151
}
5252
}
5353
}
@@ -69,10 +69,10 @@ function Get-CIPPAlertGlobalAdminAllowList {
6969
} else {
7070
$NonCompliantUpns = @($UnapprovedAdmins.Admin.userPrincipalName)
7171
$AlertData = @([PSCustomObject]@{
72-
Message = "Found $($NonCompliantUpns.Count) Global Administrator account(s) not in the approved allow list."
73-
NonCompliantUsers = $NonCompliantUpns
74-
ApprovedPrefixes = if ($AllowedAdmins) { $AllowedAdmins -join ', ' } else { 'Not provided' }
75-
Tenant = $TenantFilter
72+
Message = "Found $($NonCompliantUpns.Count) Global Administrator account(s) not in the approved allow list."
73+
NonCompliantUsers = $NonCompliantUpns -join ', '
74+
ApprovedPrefixes = if ($AllowedAdmins) { $AllowedAdmins -join ', ' } else { 'Not provided' }
75+
Tenant = $TenantFilter
7676
})
7777
}
7878

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertMXRecordChanged.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ function Get-CIPPAlertMXRecordChanged {
3030
# Update cache with current data
3131
foreach ($Domain in $DomainData) {
3232
$CacheEntity = @{
33-
PartitionKey = $TenantFilter
34-
RowKey = $Domain.Domain
35-
Domain = $Domain.Domain
36-
ActualMXRecords = $Domain.ActualMXRecords
37-
LastRefresh = $Domain.LastRefresh
38-
MailProvider = $Domain.MailProvider
33+
PartitionKey = [string]$TenantFilter
34+
RowKey = [string]$Domain.Domain
35+
Domain = [string]$Domain.Domain
36+
ActualMXRecords = [string]$Domain.ActualMXRecords
37+
LastRefresh = [string]$Domain.LastRefresh
38+
MailProvider = [string]$Domain.MailProvider
3939
}
4040
Add-CIPPAzDataTableEntity @CacheTable -Entity $CacheEntity -Force
4141
}

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertRestrictedUsers.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
3838
}
3939
} catch {
40-
Write-AlertMessage -tenant $($TenantFilter) -message "Could not get restricted users for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
40+
Write-LogMessage -tenant $($TenantFilter) -message "Could not get restricted users for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)" -severity 'Error' -API 'Get-CIPPAlertRestrictedUsers' -LogData (Get-CippException -Exception $_)
4141
}
4242
}

Modules/CIPPCore/Public/Authentication/Get-CippAllowedPermissions.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function Get-CippAllowedPermissions {
3232
$AllPermissionCacheTable = Get-CIPPTable -tablename 'cachehttppermissions'
3333
$AllPermissionsRow = Get-CIPPAzDataTableEntity @AllPermissionCacheTable -Filter "PartitionKey eq 'HttpFunctions' and RowKey eq 'HttpFunctions' and Version eq '$($Version)'"
3434

35-
if (-not $AllPermissionsRow) {
35+
if (-not $AllPermissionsRow.Permissions) {
3636
$AllPermissions = Get-CIPPHttpFunctions -ByRole | Select-Object -ExpandProperty Permission
3737
$Entity = @{
3838
PartitionKey = 'HttpFunctions'

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

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,21 @@ function Invoke-CIPPStandardsRun {
5353
Test-CIPPRerun -ClearAll -TenantFilter $TenantFilter -Type 'Standard'
5454
}
5555

56-
# Get tenant list for batch processing
57-
write-host "Getting tenants for filter: $TenantFilter"
58-
$AllTenantsList = if ($TenantFilter -eq 'allTenants') {
59-
Get-Tenants
60-
} else {
61-
Get-Tenants | Where-Object {
62-
$_.defaultDomainName -eq $TenantFilter -or $_.customerId -eq $TenantFilter
63-
}
56+
$StandardsParams = @{
57+
TenantFilter = $TenantFilter
58+
runManually = $runManually
6459
}
65-
66-
if ($AllTenantsList.Count -eq 0) {
67-
Write-Information "No tenants found for filter $TenantFilter"
68-
return
60+
if ($TemplateID) {
61+
$StandardsParams['TemplateId'] = $TemplateID
6962
}
7063

64+
$AllTenantsList = Get-CIPPStandards @StandardsParams | Select-Object -ExpandProperty Tenant | Sort-Object -Unique
65+
7166
# Build batch of per-tenant list activities
7267
$Batch = foreach ($Tenant in $AllTenantsList) {
7368
$BatchItem = @{
7469
FunctionName = 'CIPPStandardsList'
75-
TenantFilter = $Tenant.defaultDomainName
70+
TenantFilter = $Tenant
7671
runManually = $runManually
7772
}
7873
if ($TemplateID) {

Modules/CIPPCore/Public/Functions/Test-CIPPStandardLicense.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function Test-CIPPStandardLicense {
4545

4646
if ($Capabilities.Count -le 0) {
4747
if (!$SkipLog.IsPresent) {
48-
Write-LogMessage -API 'Standards' -tenant $TenantFilter -message "Tenant does not have the required capability to run standard $StandardName`: The tenant needs one of the following service plans: $($RequiredCapabilities -join ',')" -sev Error
48+
Write-LogMessage -API 'Standards' -tenant $TenantFilter -message "Tenant does not have the required capability to run standard $StandardName`: The tenant needs one of the following service plans: $($RequiredCapabilities -join ',')" -sev Info
4949
Set-CIPPStandardsCompareField -FieldName "standards.$StandardName" -FieldValue "License Missing: This tenant is not licensed for the following capabilities: $($RequiredCapabilities -join ',')" -Tenant $TenantFilter
5050
Write-Verbose "Tenant does not have the required capability to run standard $StandardName - $($RequiredCapabilities -join ','). Exiting"
5151
}
@@ -57,7 +57,7 @@ function Test-CIPPStandardLicense {
5757
if (!$SkipLog.IsPresent) {
5858
# Sanitize exception message to prevent JSON parsing issues - remove characters that could interfere with JSON detection
5959
$SanitizedMessage = $_.Exception.Message -replace '[{}\[\]]', ''
60-
Write-LogMessage -API 'Standards' -tenant $TenantFilter -message "Error checking license capabilities for standard $StandardName`: $SanitizedMessage" -sev Error
60+
Write-LogMessage -API 'Standards' -tenant $TenantFilter -message "Error checking license capabilities for standard $StandardName`: $SanitizedMessage" -sev Info
6161
Set-CIPPStandardsCompareField -FieldName "standards.$StandardName" -FieldValue "License Missing: Error checking license capabilities - $SanitizedMessage" -Tenant $TenantFilter
6262
}
6363
return $false

0 commit comments

Comments
 (0)