Skip to content

Commit 2420998

Browse files
authored
Merge pull request #147 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents ffebdb1 + 8e7d901 commit 2420998

File tree

76 files changed

+550
-291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+550
-291
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Groups/Invoke-ListGroups.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Function Invoke-ListGroups {
3636
}
3737

3838
if ($Request.Query.owners) {
39-
if ($Request.Query.groupType -ne 'Distribution List' -or $Request.Query.groupType -ne 'Mail-Enabled Security') {
39+
if ($Request.Query.groupType -ne 'Distribution List' -and $Request.Query.groupType -ne 'Mail-Enabled Security') {
4040
$selectstring = 'id,userPrincipalName,displayName,hideFromOutlookClients,hideFromAddressLists,mail,mailEnabled,mailNickname,resourceProvisioningOptions,securityEnabled,visibility,organizationId,onPremisesSamAccountName,membershipRule'
4141
$BulkRequestArrayList.add(@{
4242
id = 3

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardBranding.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ function Invoke-CIPPStandardBranding {
9494
if ($StateIsCorrect -eq $true) {
9595
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'Branding is correctly set.' -Sev Info
9696
} else {
97-
Write-StandardsAlert -message "Branding is incorrectly set." -object $CurrentState -tenant $Tenant -standardName 'Branding' -standardId $Settings.standardId
97+
Write-StandardsAlert -message 'Branding is incorrectly set.' -object $CurrentState -tenant $Tenant -standardName 'Branding' -standardId $Settings.standardId
9898
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'Branding is incorrectly set.' -Sev Info
9999
}
100100
}
101101

102102
If ($Settings.report -eq $true) {
103+
$state = $StateIsCorrect -eq $true ? $true : $StateIsCorrect
104+
Set-CIPPStandardsCompareField -FieldName 'standards.Branding' -FieldValue $state -TenantFilter $Tenant
103105
Add-CIPPBPAField -FieldName 'Branding' -FieldValue [bool]$StateIsCorrect -StoreAs bool -Tenant $Tenant
104106
}
105107
}

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardCloudMessageRecall.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function Invoke-CIPPStandardCloudMessageRecall {
4141
if ($Settings.report -eq $true) {
4242
# Default is not set, not set means it's enabled
4343
if ($null -eq $CurrentState ) { $CurrentState = $true }
44+
Set-CIPPStandardsCompareField -FieldName 'standards.CloudMessageRecall' -FieldValue $CurrentState -TenantFilter $Tenant
4445
Add-CIPPBPAField -FieldName 'MessageRecall' -FieldValue $CurrentState -StoreAs bool -Tenant $Tenant
4546
}
4647

@@ -70,7 +71,7 @@ function Invoke-CIPPStandardCloudMessageRecall {
7071
if ($StateIsCorrect -eq $true) {
7172
Write-LogMessage -API 'Standards' -tenant $Tenant -message "The tenant Message Recall is set correctly to $state" -sev Info
7273
} else {
73-
Write-StandardsAlert -message "The tenant Message Recall is not set correctly to $state" -object @{CurrentState = $CurrentState; WantedState = $WantedState} -tenant $Tenant -standardName 'CloudMessageRecall' -standardId $Settings.standardId
74+
Write-StandardsAlert -message "The tenant Message Recall is not set correctly to $state" -object @{CurrentState = $CurrentState; WantedState = $WantedState } -tenant $Tenant -standardName 'CloudMessageRecall' -standardId $Settings.standardId
7475
Write-LogMessage -API 'Standards' -tenant $Tenant -message "The tenant Message Recall is not set correctly to $state" -sev Info
7576
}
7677
}

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDelegateSentItems.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ function Invoke-CIPPStandardDelegateSentItems {
3939

4040
if ($Settings.IncludeUserMailboxes -eq $true) {
4141
$Mailboxes = New-ExoRequest -tenantid $Tenant -cmdlet 'Get-Mailbox' -cmdParams @{ RecipientTypeDetails = @('UserMailbox', 'SharedMailbox') } -Select 'Identity,UserPrincipalName,MessageCopyForSendOnBehalfEnabled,MessageCopyForSentAsEnabled' |
42-
Where-Object { $_.MessageCopyForSendOnBehalfEnabled -eq $false -or $_.MessageCopyForSentAsEnabled -eq $false }
42+
Where-Object { $_.MessageCopyForSendOnBehalfEnabled -eq $false -or $_.MessageCopyForSentAsEnabled -eq $false }
4343
} else {
4444
$Mailboxes = New-ExoRequest -tenantid $Tenant -cmdlet 'Get-Mailbox' -cmdParams @{ RecipientTypeDetails = @('SharedMailbox') } -Select 'Identity,UserPrincipalName,MessageCopyForSendOnBehalfEnabled,MessageCopyForSentAsEnabled' |
45-
Where-Object { $_.MessageCopyForSendOnBehalfEnabled -eq $false -or $_.MessageCopyForSentAsEnabled -eq $false }
45+
Where-Object { $_.MessageCopyForSendOnBehalfEnabled -eq $false -or $_.MessageCopyForSentAsEnabled -eq $false }
4646
}
4747

4848

@@ -89,6 +89,8 @@ function Invoke-CIPPStandardDelegateSentItems {
8989

9090
if ($Settings.report -eq $true) {
9191
$Filtered = $Mailboxes | Select-Object -Property UserPrincipalName, MessageCopyForSendOnBehalfEnabled, MessageCopyForSentAsEnabled
92+
$CurrentState = if ($null -eq $Mailboxes) { $true } else { $Filtered }
93+
Set-CIPPStandardsCompareField -FieldName 'standards.DelegateSentItems' -FieldValue $CurrentState -TenantFilter $Tenant
9294
Add-CIPPBPAField -FieldName 'DelegateSentItems' -FieldValue $Filtered -StoreAs json -Tenant $Tenant
9395
}
9496
}

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDeletedUserRentention.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ function Invoke-CIPPStandardDeletedUserRentention {
3232
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'DeletedUserRetention'
3333

3434
$CurrentInfo = New-GraphGetRequest -Uri 'https://graph.microsoft.com/beta/admin/sharepoint/settings' -tenantid $Tenant -AsApp $true
35+
$Days = $Settings.Days.value ?? $Settings.Days
3536

3637
if ($Settings.report -eq $true) {
38+
$CurrentState = $CurrentInfo.deletedUserPersonalSiteRetentionPeriodInDays -eq $Days ? $true : $CurrentInfo.deletedUserPersonalSiteRetentionPeriodInDays
39+
Set-CIPPStandardsCompareField -FieldName 'standards.DeletedUserRentention' -FieldValue $CurrentState -TenantFilter $Tenant
3740
Add-CIPPBPAField -FieldName 'DeletedUserRentention' -FieldValue $CurrentInfo.deletedUserPersonalSiteRetentionPeriodInDays -StoreAs string -Tenant $Tenant
3841
}
3942

4043
# Get days value using null-coalescing operator
41-
$Days = $Settings.Days.value ?? $Settings.Days
4244

4345
# Input validation
4446
if (($Days -eq 'Select a value') -and ($Settings.remediate -eq $true -or $Settings.alert -eq $true)) {

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDisableAddShortcutsToOneDrive.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function Invoke-CIPPStandardDisableAddShortcutsToOneDrive {
3434
$CurrentState = Get-CIPPSPOTenant -TenantFilter $Tenant | Select-Object _ObjectIdentity_, TenantFilter, DisableAddToOneDrive
3535

3636
if ($Settings.report -eq $true) {
37+
Set-CIPPStandardsCompareField -FieldName 'standards.OneDriveAddShortcutButtonDisabled' -FieldValue $CurrentState.DisableAddToOneDrive -TenantFilter $Tenant
3738
Add-CIPPBPAField -FieldName 'OneDriveAddShortcutButtonDisabled' -FieldValue $CurrentState.DisableAddToOneDrive -StoreAs bool -Tenant $Tenant
3839
}
3940

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDisableAdditionalStorageProviders.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,15 @@ function Invoke-CIPPStandardDisableAdditionalStorageProviders {
5454

5555
if ($Settings.alert -eq $true) {
5656
if ($AdditionalStorageProvidersState.AdditionalStorageProvidersAvailable) {
57-
Write-StandardsAlert -message "OWA additional storage providers are enabled" -object $AdditionalStorageProvidersState -tenant $tenant -standardName 'DisableAdditionalStorageProviders' -standardId $Settings.standardId
57+
Write-StandardsAlert -message 'OWA additional storage providers are enabled' -object $AdditionalStorageProvidersState -tenant $tenant -standardName 'DisableAdditionalStorageProviders' -standardId $Settings.standardId
5858
Write-LogMessage -API 'Standards' -tenant $tenant -message 'OWA additional storage providers are enabled' -sev Info
5959
} else {
6060
Write-LogMessage -API 'Standards' -tenant $tenant -message 'OWA additional storage providers are disabled' -sev Info
6161
}
6262
}
6363

6464
if ($Settings.report -eq $true) {
65+
Set-CIPPStandardsCompareField -FieldName 'standards.AdditionalStorageProvidersEnabled' -FieldValue $AdditionalStorageProvidersState.AdditionalStorageProvidersEnabled -TenantFilter $Tenant
6566
Add-CIPPBPAField -FieldName 'AdditionalStorageProvidersEnabled' -FieldValue $AdditionalStorageProvidersState.AdditionalStorageProvidersEnabled -StoreAs bool -Tenant $tenant
6667
}
6768
}

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDisableAppCreation.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ function Invoke-CIPPStandardDisableAppCreation {
5757
if ($CurrentInfo.defaultUserRolePermissions.allowedToCreateApps -eq $false) {
5858
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Users are not allowed to create App registrations.' -sev Info
5959
} else {
60-
Write-StandardsAlert -message "Users are allowed to create App registrations." -object $CurrentInfo -tenant $tenant -standardName 'DisableAppCreation' -standardId $Settings.standardId
60+
Write-StandardsAlert -message 'Users are allowed to create App registrations.' -object $CurrentInfo -tenant $tenant -standardName 'DisableAppCreation' -standardId $Settings.standardId
6161
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Users are allowed to create App registrations.' -sev Info
6262
}
6363
}
6464

6565
if ($Settings.report -eq $true) {
6666
$State = -not $CurrentInfo.defaultUserRolePermissions.allowedToCreateApps
67+
Set-CIPPStandardsCompareField -FieldName 'standards.DisableAppCreation' -FieldValue $State -TenantFilter $Tenant
6768
Add-CIPPBPAField -FieldName 'UserAppCreationDisabled' -FieldValue $State -StoreAs bool -Tenant $tenant
6869
}
6970
}

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDisableBasicAuthSMTP.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,18 @@ function Invoke-CIPPStandardDisableBasicAuthSMTP {
8383
if ($CurrentInfo.SmtpClientAuthenticationDisabled -and $SMTPusers.Count -eq 0) {
8484
Write-LogMessage -API 'Standards' -tenant $tenant -message 'SMTP Basic Authentication for tenant and all users is disabled' -sev Info
8585
} else {
86-
Write-StandardsAlert -message ($LogMessage -join '') -object @{TenantSMTPAuthDisabled = $CurrentInfo.SmtpClientAuthenticationDisabled; UsersWithSMTPAuthEnabled = $SMTPusers.Count} -tenant $tenant -standardName 'DisableBasicAuthSMTP' -standardId $Settings.standardId
86+
Write-StandardsAlert -message ($LogMessage -join '') -object @{TenantSMTPAuthDisabled = $CurrentInfo.SmtpClientAuthenticationDisabled; UsersWithSMTPAuthEnabled = $SMTPusers.Count } -tenant $tenant -standardName 'DisableBasicAuthSMTP' -standardId $Settings.standardId
8787
Write-LogMessage -API 'Standards' -tenant $tenant -message ($LogMessage -join '') -sev Info
8888
}
8989
}
9090

9191
if ($Settings.report -eq $true) {
9292
if ($CurrentInfo.SmtpClientAuthenticationDisabled -and $SMTPusers.Count -eq 0) {
93+
Set-CIPPStandardsCompareField -FieldName 'standards.DisableBasicAuthSMTP' -FieldValue $true -TenantFilter $Tenant
9394
Add-CIPPBPAField -FieldName 'DisableBasicAuthSMTP' -FieldValue $CurrentInfo.SmtpClientAuthenticationDisabled -StoreAs bool -Tenant $tenant
9495
} else {
9596
$Logs = $LogMessage | Select-Object @{n = 'Message'; e = { $_ } }
97+
Set-CIPPStandardsCompareField -FieldName 'standards.DisableBasicAuthSMTP' -FieldValue $logs -TenantFilter $Tenant
9698
Add-CIPPBPAField -FieldName 'DisableBasicAuthSMTP' -FieldValue $Logs -StoreAs json -Tenant $tenant
9799
}
98100
}

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardDisableEmail.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ function Invoke-CIPPStandardDisableEmail {
4848
if ($StateIsCorrect -eq $true) {
4949
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Email authentication method is not enabled' -sev Info
5050
} else {
51-
Write-StandardsAlert -message "Email authentication method is enabled" -object $CurrentState -tenant $tenant -standardName 'DisableEmail' -standardId $Settings.standardId
51+
Write-StandardsAlert -message 'Email authentication method is enabled' -object $CurrentState -tenant $tenant -standardName 'DisableEmail' -standardId $Settings.standardId
5252
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Email authentication method is enabled' -sev Info
5353
}
5454
}
5555

5656
if ($Settings.report -eq $true) {
57+
$state = $StateIsCorrect -eq $true ? $true : $CurrentState
58+
Set-CIPPStandardsCompareField -FieldName 'standards.DisableEmail' -FieldValue $state -TenantFilter $Tenant
5759
Add-CIPPBPAField -FieldName 'DisableEmail' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $tenant
5860
}
5961
}

0 commit comments

Comments
 (0)