Skip to content

Commit 5bfc23f

Browse files
committed
updated standards
1 parent 205dc39 commit 5bfc23f

29 files changed

+342
-180
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ function Invoke-CIPPStandardSPAzureB2B {
3030
#>
3131

3232
param($Tenant, $Settings)
33-
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'SPAzureB2B'
3433

3534
$CurrentState = Get-CIPPSPOTenant -TenantFilter $Tenant |
36-
Select-Object -Property EnableAzureADB2BIntegration
35+
Select-Object -Property EnableAzureADB2BIntegration
3736

3837
$StateIsCorrect = ($CurrentState.EnableAzureADB2BIntegration -eq $true)
3938

@@ -65,5 +64,11 @@ function Invoke-CIPPStandardSPAzureB2B {
6564

6665
if ($Settings.report -eq $true) {
6766
Add-CIPPBPAField -FieldName 'AzureB2B' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $tenant
67+
if ($StateIsCorrect) {
68+
$FieldValue = $true
69+
} else {
70+
$FieldValue = $CurrentState
71+
}
72+
Set-CIPPStandardsCompareField -FieldName 'standards.SPAzureB2B' -FieldValue $FieldValue -Tenant $Tenant
6873
}
6974
}

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ function Invoke-CIPPStandardSPDirectSharing {
3131
#>
3232

3333
param($Tenant, $Settings)
34-
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'SPDirectSharing'
3534

3635
$CurrentState = Get-CIPPSPOTenant -TenantFilter $Tenant |
37-
Select-Object -Property DefaultSharingLinkType
36+
Select-Object -Property DefaultSharingLinkType
3837

3938
$StateIsCorrect = ($CurrentState.DefaultSharingLinkType -eq 'Direct' -or $CurrentState.DefaultSharingLinkType -eq 1)
4039

@@ -66,5 +65,12 @@ function Invoke-CIPPStandardSPDirectSharing {
6665

6766
if ($Settings.report -eq $true) {
6867
Add-CIPPBPAField -FieldName 'DirectSharing' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $tenant
68+
69+
if ($StateIsCorrect) {
70+
$FieldValue = $true
71+
} else {
72+
$FieldValue = $CurrentState
73+
}
74+
Set-CIPPStandardsCompareField -FieldName 'standards.SPDirectSharing' -FieldValue $FieldValue -Tenant $Tenant
6975
}
7076
}

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ function Invoke-CIPPStandardSPDisableLegacyWorkflows {
2727
https://docs.cipp.app/user-documentation/tenant/standards/list-standards/sharepoint-standards#low-impact
2828
#>
2929
param($Tenant, $Settings)
30-
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'SPDisableLegacyWorkflows'
3130

3231
$CurrentState = Get-CIPPSPOTenant -TenantFilter $Tenant |
33-
Select-Object -Property *
32+
Select-Object -Property *
3433

3534
$StateIsCorrect = ($CurrentState.StopNew2010Workflows -eq $true) -and
36-
($CurrentState.StopNew2013Workflows -eq $true) -and
37-
($CurrentState.DisableBackToClassic -eq $true)
35+
($CurrentState.StopNew2013Workflows -eq $true) -and
36+
($CurrentState.DisableBackToClassic -eq $true)
3837

3938
if ($Settings.remediate -eq $true) {
4039
if ($StateIsCorrect -eq $true) {
@@ -66,5 +65,11 @@ function Invoke-CIPPStandardSPDisableLegacyWorkflows {
6665

6766
if ($Settings.report -eq $true) {
6867
Add-CIPPBPAField -FieldName 'SPDisableLegacyWorkflows' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $Tenant
68+
if ($StateIsCorrect) {
69+
$FieldValue = $true
70+
} else {
71+
$FieldValue = $CurrentState
72+
}
73+
Set-CIPPStandardsCompareField -FieldName 'standards.SPDisableLegacyWorkflows' -FieldValue $FieldValue -Tenant $Tenant
6974
}
7075
}

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ function Invoke-CIPPStandardSPDisallowInfectedFiles {
3131
#>
3232

3333
param($Tenant, $Settings)
34-
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'SPDisallowInfectedFiles'
3534

3635
$CurrentState = Get-CIPPSPOTenant -TenantFilter $Tenant |
37-
Select-Object -Property DisallowInfectedFileDownload
36+
Select-Object -Property DisallowInfectedFileDownload
3837

3938
$StateIsCorrect = ($CurrentState.DisallowInfectedFileDownload -eq $true)
4039

@@ -66,5 +65,12 @@ function Invoke-CIPPStandardSPDisallowInfectedFiles {
6665

6766
if ($Settings.report -eq $true) {
6867
Add-CIPPBPAField -FieldName 'SPDisallowInfectedFiles' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $Tenant
68+
69+
if ($StateIsCorrect) {
70+
$FieldValue = $true
71+
} else {
72+
$FieldValue = $CurrentState
73+
}
74+
Set-CIPPStandardsCompareField -FieldName 'standards.SPDisallowInfectedFiles' -FieldValue $FieldValue -Tenant $Tenant
6975
}
7076
}

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ function Invoke-CIPPStandardSPEmailAttestation {
3232
#>
3333

3434
param($Tenant, $Settings)
35-
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'SPEmailAttestation'
3635

3736
$CurrentState = Get-CIPPSPOTenant -TenantFilter $Tenant |
38-
Select-Object -Property EmailAttestationReAuthDays, EmailAttestationRequired
37+
Select-Object -Property EmailAttestationReAuthDays, EmailAttestationRequired
3938

4039
$StateIsCorrect = ($CurrentState.EmailAttestationReAuthDays -eq $Settings.Days) -and
41-
($CurrentState.EmailAttestationRequired -eq $true)
40+
($CurrentState.EmailAttestationRequired -eq $true)
4241

4342
if ($Settings.remediate -eq $true) {
4443
if ($StateIsCorrect -eq $true) {
@@ -69,5 +68,11 @@ function Invoke-CIPPStandardSPEmailAttestation {
6968

7069
if ($Settings.report -eq $true) {
7170
Add-CIPPBPAField -FieldName 'SPEmailAttestation' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $Tenant
71+
if ($StateIsCorrect) {
72+
$FieldValue = $true
73+
} else {
74+
$FieldValue = $CurrentState
75+
}
76+
Add-CIPPBPAField -FieldName 'standards.SPEmailAttestation' -FieldValue $FieldValue -StoreAs bool -Tenant $Tenant
7277
}
7378
}

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,12 @@ function Invoke-CIPPStandardSPExternalUserExpiration {
3131
#>
3232

3333
param($Tenant, $Settings)
34-
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'SPExternalUserExpiration'
3534

3635
$CurrentState = Get-CIPPSPOTenant -TenantFilter $Tenant |
3736
Select-Object -Property ExternalUserExpireInDays, ExternalUserExpirationRequired
3837

3938
$StateIsCorrect = ($CurrentState.ExternalUserExpireInDays -eq $Settings.Days) -and
40-
($CurrentState.ExternalUserExpirationRequired -eq $true)
39+
($CurrentState.ExternalUserExpirationRequired -eq $true)
4140

4241
if ($Settings.remediate -eq $true) {
4342
if ($StateIsCorrect -eq $true) {
@@ -68,5 +67,11 @@ function Invoke-CIPPStandardSPExternalUserExpiration {
6867

6968
if ($Settings.report -eq $true) {
7069
Add-CIPPBPAField -FieldName 'ExternalUserExpiration' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $Tenant
70+
if ($StateIsCorrect) {
71+
$FieldValue = $true
72+
} else {
73+
$FieldValue = $CurrentState
74+
}
75+
Add-CIPPBPAField -FieldName 'standards.SPExternalUserExpiration' -FieldValue $FieldValue -StoreAs bool -Tenant $Tenant
7176
}
7277
}

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,15 @@ function Invoke-CIPPStandardSPSyncButtonState {
2929
#>
3030

3131
param($Tenant, $Settings)
32-
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'SPSyncButtonState'
3332

3433
$CurrentState = Get-CIPPSPOTenant -TenantFilter $Tenant | Select-Object _ObjectIdentity_, TenantFilter, HideSyncButtonOnDocLib
3534

36-
if ($Settings.report -eq $true) {
37-
Add-CIPPBPAField -FieldName 'SPSyncButtonDisabled' -FieldValue $CurrentState.HideSyncButtonOnDocLib -StoreAs bool -Tenant $Tenant
38-
}
3935

4036
# Input validation
4137
$StateValue = $Settings.state.value ?? $Settings.state
4238
if (([string]::IsNullOrWhiteSpace($StateValue) -or $StateValue -eq 'Select a value') -and ($Settings.remediate -eq $true -or $Settings.alert -eq $true)) {
4339
Write-LogMessage -API 'Standards' -tenant $tenant -message 'SPSyncButtonState: Invalid state parameter set' -sev Error
44-
Return
40+
return
4541
}
4642

4743
$WantedState = [System.Convert]::ToBoolean($StateValue)
@@ -73,4 +69,15 @@ function Invoke-CIPPStandardSPSyncButtonState {
7369
Write-LogMessage -API 'Standards' -tenant $tenant -message "The SharePoint Sync Button is not set to the wanted state of $HumanReadableState" -sev Info
7470
}
7571
}
72+
73+
if ($Settings.report -eq $true) {
74+
Add-CIPPBPAField -FieldName 'SPSyncButtonDisabled' -FieldValue $CurrentState.HideSyncButtonOnDocLib -StoreAs bool -Tenant $Tenant
75+
if ($StateIsCorrect) {
76+
$FieldValue = $true
77+
} else {
78+
$FieldValue = $CurrentState
79+
}
80+
Set-CIPPStandardsCompareField -FieldName 'standards.SPSyncButtonState' -FieldValue $FieldValue -Tenant $Tenant
81+
}
82+
7683
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ function Invoke-CIPPStandardSecurityDefaults {
2828
#>
2929

3030
param($Tenant, $Settings)
31-
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'SecurityDefaults'
3231

3332
$SecureDefaultsState = (New-GraphGetRequest -Uri 'https://graph.microsoft.com/beta/policies/identitySecurityDefaultsEnforcementPolicy' -tenantid $tenant)
3433

35-
If ($Settings.remediate -eq $true) {
34+
if ($Settings.remediate -eq $true) {
3635

3736
if ($SecureDefaultsState.IsEnabled -ne $true) {
3837
try {
@@ -54,12 +53,13 @@ function Invoke-CIPPStandardSecurityDefaults {
5453
if ($SecureDefaultsState.IsEnabled -eq $true) {
5554
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Security Defaults is enabled.' -sev Info
5655
} else {
57-
Write-StandardsAlert -message "Security Defaults is not enabled" -object $SecureDefaultsState -tenant $tenant -standardName 'SecurityDefaults' -standardId $Settings.standardId
56+
Write-StandardsAlert -message 'Security Defaults is not enabled' -object $SecureDefaultsState -tenant $tenant -standardName 'SecurityDefaults' -standardId $Settings.standardId
5857
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Security Defaults is not enabled.' -sev Info
5958
}
6059
}
6160

6261
if ($Settings.report -eq $true) {
6362
Add-CIPPBPAField -FieldName 'SecurityDefaults' -FieldValue $SecureDefaultsState.IsEnabled -StoreAs bool -Tenant $tenant
63+
Set-CIPPStandardsCompareField -FieldName 'standards.SecurityDefaults' -FieldValue $SecureDefaultsState.IsEnabled -Tenant $tenant
6464
}
6565
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ function Invoke-CIPPStandardSendFromAlias {
2929
#>
3030

3131
param($Tenant, $Settings)
32-
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'SendFromAlias'
3332

3433
$CurrentInfo = (New-ExoRequest -tenantid $Tenant -cmdlet 'Get-OrganizationConfig').SendFromAliasEnabled
3534

36-
If ($Settings.remediate -eq $true) {
35+
if ($Settings.remediate -eq $true) {
3736
if ($CurrentInfo -eq $false) {
3837
try {
3938
New-ExoRequest -tenantid $Tenant -cmdlet 'Set-OrganizationConfig' -cmdParams @{ SendFromAliasEnabled = $true }
@@ -52,12 +51,13 @@ function Invoke-CIPPStandardSendFromAlias {
5251
if ($CurrentInfo -eq $true) {
5352
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Send from alias is enabled.' -sev Info
5453
} else {
55-
Write-StandardsAlert -message "Send from alias is not enabled" -object $CurrentInfo -tenant $tenant -standardName 'SendFromAlias' -standardId $Settings.standardId
54+
Write-StandardsAlert -message 'Send from alias is not enabled' -object $CurrentInfo -tenant $tenant -standardName 'SendFromAlias' -standardId $Settings.standardId
5655
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Send from alias is not enabled.' -sev Info
5756
}
5857
}
5958

6059
if ($Settings.report -eq $true) {
6160
Add-CIPPBPAField -FieldName 'SendFromAlias' -FieldValue $CurrentInfo -StoreAs bool -Tenant $tenant
61+
Set-CIPPStandardsCompareField -FieldName 'standards.SendFromAlias' -FieldValue $CurrentInfo -Tenant $tenant
6262
}
6363
}

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,17 @@ function Invoke-CIPPStandardSendReceiveLimitTenant {
3030
#>
3131

3232
param($Tenant, $Settings)
33-
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'SendReceiveLimitTenant'
3433

3534
# Input validation
3635
if ([Int32]$Settings.SendLimit -lt 1 -or [Int32]$Settings.SendLimit -gt 150) {
3736
Write-LogMessage -API 'Standards' -tenant $tenant -message 'SendReceiveLimitTenant: Invalid SendLimit parameter set' -sev Error
38-
Return
37+
return
3938
}
4039

4140
# Input validation
4241
if ([Int32]$Settings.ReceiveLimit -lt 1 -or [Int32]$Settings.ReceiveLimit -gt 150) {
4342
Write-LogMessage -API 'Standards' -tenant $tenant -message 'SendReceiveLimitTenant: Invalid ReceiveLimit parameter set' -sev Error
44-
Return
43+
return
4544
}
4645

4746

@@ -57,7 +56,7 @@ function Invoke-CIPPStandardSendReceiveLimitTenant {
5756
}
5857
}
5958

60-
If ($Settings.remediate -eq $true) {
59+
if ($Settings.remediate -eq $true) {
6160
Write-Host "Time to remediate. Our Settings are $($Settings.SendLimit)MB and $($Settings.ReceiveLimit)MB"
6261

6362
if ($NotSetCorrectly.Count -gt 0) {
@@ -88,5 +87,12 @@ function Invoke-CIPPStandardSendReceiveLimitTenant {
8887

8988
if ($Settings.report -eq $true) {
9089
Add-CIPPBPAField -FieldName 'SendReceiveLimit' -FieldValue $NotSetCorrectly -StoreAs json -Tenant $tenant
90+
91+
if ($NotSetCorrectly.Count -eq 0) {
92+
$FieldValue = $true
93+
} else {
94+
$FieldValue = $NotSetCorrectly
95+
}
96+
Set-CIPPStandardsCompareField -FieldName 'standards.SendReceiveLimitTenant' -FieldValue $FieldValue -Tenant $tenant
9197
}
9298
}

0 commit comments

Comments
 (0)