Skip to content

Commit 0214416

Browse files
fixed issues with standards not reporting correctly.
1 parent 26d556b commit 0214416

23 files changed

+89
-123
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function Invoke-CIPPStandardAddDKIM {
107107
}
108108

109109
if ($Settings.report -eq $true) {
110-
$DKIMState = if ($null -eq $NewDomains -and $null -eq $SetDomains) { $true } else { $false }
110+
$DKIMState = if ($null -eq $NewDomains -and $null -eq $SetDomains) { $true } else { $SetDomains, $NewDomains }
111111
Set-CIPPStandardsCompareField -FieldName 'standards.AddDKIM' -FieldValue $DKIMState -TenantFilter $tenant
112112
Add-CIPPBPAField -FieldName 'DKIM' -FieldValue $DKIMState -StoreAs bool -Tenant $tenant
113113
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function Invoke-CIPPStandardAppDeploy {
6969
}
7070

7171
if ($Settings.report -eq $true) {
72-
$StateIsCorrect = $MissingApps.Count -eq 0 ? $true : @{appids = $MissingApps -join ',' }
72+
$StateIsCorrect = $MissingApps.Count -eq 0 ? $true : @{ 'Missing Apps' = $MissingApps -join ',' }
7373
Set-CIPPStandardsCompareField -FieldName 'standards.AppDeploy' -FieldValue $StateIsCorrect -TenantFilter $tenant
7474
Add-CIPPBPAField -FieldName 'AppDeploy' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $tenant
7575
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ function Invoke-CIPPStandardDisableReshare {
6161
}
6262

6363
if ($Settings.report -eq $true) {
64-
Set-CIPPStandardsCompareField -FieldName 'standards.DisableReshare' -FieldValue $CurrentInfo.isResharingByExternalUsersEnabled -TenantFilter $Tenant
64+
$state = $CurrentInfo.isResharingByExternalUsersEnabled ? ($CurrentInfo | Select-Object isResharingByExternalUsersEnabled) : $true
65+
Set-CIPPStandardsCompareField -FieldName 'standards.DisableReshare' -FieldValue $state -TenantFilter $Tenant
6566
Add-CIPPBPAField -FieldName 'DisableReshare' -FieldValue $CurrentInfo.isResharingByExternalUsersEnabled -StoreAs bool -Tenant $tenant
6667
}
6768
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ function Invoke-CIPPStandardDisableSecurityGroupUsers {
5959
}
6060

6161
if ($Settings.report -eq $true) {
62-
Set-CIPPStandardsCompareField -FieldName 'standards.DisableSecurityGroupUsers' -FieldValue $CurrentInfo.defaultUserRolePermissions.allowedToCreateSecurityGroups -Tenant $tenant
62+
$state = $CurrentInfo.defaultUserRolePermissions.allowedToCreateSecurityGroups -eq $false ? $true : ($currentInfo.defaultUserRolePermissions | Select-Object allowedToCreateSecurityGroups)
63+
Set-CIPPStandardsCompareField -FieldName 'standards.DisableSecurityGroupUsers' -FieldValue $state -Tenant $tenant
6364
Add-CIPPBPAField -FieldName 'DisableSecurityGroupUsers' -FieldValue $CurrentInfo.defaultUserRolePermissions.allowedToCreateSecurityGroups -StoreAs bool -Tenant $tenant
6465
}
6566
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ function Invoke-CIPPStandardDisableSharePointLegacyAuth {
6262
}
6363
}
6464
if ($Settings.report -eq $true) {
65-
Set-CIPPStandardsCompareField -FieldName 'standards.DisableSharePointLegacyAuth' -FieldValue $CurrentInfo.isLegacyAuthProtocolsEnabled -TenantFilter $Tenant
65+
$state = $CurrentInfo.isLegacyAuthProtocolsEnabled ? ($CurrentInfo | Select-Object isLegacyAuthProtocolsEnabled) : $true
66+
Set-CIPPStandardsCompareField -FieldName 'standards.DisableSharePointLegacyAuth' -FieldValue $state -TenantFilter $Tenant
6667
Add-CIPPBPAField -FieldName 'SharePointLegacyAuthEnabled' -FieldValue $CurrentInfo.isLegacyAuthProtocolsEnabled -StoreAs bool -Tenant $tenant
6768
}
6869
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function Invoke-CIPPStandardDisableUserSiteCreate {
6060
}
6161

6262
if ($Settings.report -eq $true) {
63-
$state = $CurrentInfo.isSiteCreationEnabled -and $CurrentInfo.isSiteCreationUIEnabled ? $true : ($CurrentInfo | Select-Object isSiteCreationEnabled, isSiteCreationUIEnabled)
63+
$state = $CurrentInfo.isSiteCreationEnabled -and $CurrentInfo.isSiteCreationUIEnabled ? ($CurrentInfo | Select-Object isSiteCreationEnabled, isSiteCreationUIEnabled) : $true
6464
Set-CIPPStandardsCompareField -FieldName 'standards.DisableUserSiteCreate' -FieldValue $State -Tenant $tenant
6565
Add-CIPPBPAField -FieldName 'DisableUserSiteCreate' -FieldValue $CurrentInfo.isSiteCreationEnabled -StoreAs bool -Tenant $tenant
6666
Add-CIPPBPAField -FieldName 'DisableUserSiteCreateUI' -FieldValue $CurrentInfo.isSiteCreationUIEnabled -StoreAs bool -Tenant $tenant

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function Invoke-CIPPStandardDisableViva {
4747
} else {
4848
try {
4949
# TODO This does not work without Global Admin permissions for some reason. Throws an "EXCEPTION: Tenant admin role is required" error. -Bobby
50-
New-GraphPOSTRequest -Uri "https://graph.microsoft.com/beta/organization/$Tenant/settings/peopleInsights" -tenantid $Tenant -AsApp $true -Type PATCH -Body '{"isEnabledInOrganization": false}' -ContentType 'application/json'
50+
New-GraphPOSTRequest -Uri "https://graph.microsoft.com/beta/organization/$Tenant/settings/peopleInsights" -tenantid $Tenant -Type PATCH -Body '{"isEnabledInOrganization": false}' -ContentType 'application/json'
5151
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Disabled Viva insights' -sev Info
5252
} catch {
5353
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message
@@ -57,7 +57,6 @@ function Invoke-CIPPStandardDisableViva {
5757
}
5858

5959
if ($Settings.alert -eq $true) {
60-
6160
if ($CurrentSetting.isEnabledInOrganization -eq $false) {
6261
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'Viva is disabled' -sev Info
6362
} else {

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,13 @@ function Invoke-CIPPStandardEXODisableAutoForwarding {
3939
$StateIsCorrect = $CurrentInfo.AutoForwardingMode -eq 'Off'
4040

4141
If ($Settings.remediate -eq $true) {
42-
Write-Host 'Time to remediate!'
4342

44-
if ($StateIsCorrect -eq $false) {
45-
try {
46-
New-ExoRequest -tenantid $tenant -cmdlet 'Set-HostedOutboundSpamFilterPolicy' -cmdparams @{ Identity = 'Default'; AutoForwardingMode = 'Off' } -useSystemMailbox $true
47-
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Disabled auto forwarding' -sev Info
48-
} catch {
49-
$ErrorMessage = Get-CippException -Exception $_
50-
Write-LogMessage -API 'Standards' -tenant $tenant -message "Could not disable auto forwarding. $($ErrorMessage.NormalizedError)" -sev Error
51-
}
52-
} else {
53-
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Auto forwarding is already disabled.' -sev Info
43+
try {
44+
New-ExoRequest -tenantid $tenant -cmdlet 'Set-HostedOutboundSpamFilterPolicy' -cmdparams @{ Identity = 'Default'; AutoForwardingMode = 'Off' } -useSystemMailbox $true
45+
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Disabled auto forwarding' -sev Info
46+
} catch {
47+
$ErrorMessage = Get-CippException -Exception $_
48+
Write-LogMessage -API 'Standards' -tenant $tenant -message "Could not disable auto forwarding. $($ErrorMessage.NormalizedError)" -sev Error
5449
}
5550
}
5651

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function Invoke-CIPPStandardEnableAppConsentRequests {
105105
}
106106
if ($Settings.report -eq $true) {
107107
$state = $CurrentInfo.isEnabled ? $true : $CurrentInfo
108-
Set-CIPPStandardsCompareField -FieldName 'standards.Disablex509Certificate' -FieldValue $state -TenantFilter $Tenant
108+
Set-CIPPStandardsCompareField -FieldName 'standards.EnableAppConsentRequests' -FieldValue $state -TenantFilter $Tenant
109109
Add-CIPPBPAField -FieldName 'EnableAppConsentAdminRequests' -FieldValue $CurrentInfo.isEnabled -StoreAs bool -Tenant $tenant
110110
}
111111
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ function Invoke-CIPPStandardEnableCustomerLockbox {
6464
}
6565

6666
if ($Settings.report -eq $true) {
67-
Set-StandardsCompareField -FieldName 'standards.EnableCustomerLockbox' -FieldValue $CustomerLockboxStatus -Tenant $tenant
67+
$state = $CustomerLockboxStatus ? $true : $false
68+
Set-CIPPStandardsCompareField -FieldName 'standards.EnableCustomerLockbox' -FieldValue $state -Tenant $tenant
6869
Add-CIPPBPAField -FieldName 'CustomerLockboxEnabled' -FieldValue $CustomerLockboxStatus -StoreAs bool -Tenant $tenant
6970
}
7071
}

0 commit comments

Comments
 (0)