Skip to content

Commit 8e7d901

Browse files
committed
more standards
1 parent 568d1b8 commit 8e7d901

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,11 @@ function Invoke-CIPPStandardPasswordExpireDisabled {
3232
#>
3333

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

3736
$GraphRequest = New-GraphGetRequest -uri 'https://graph.microsoft.com/v1.0/domains' -tenantid $Tenant
3837
$DomainswithoutPassExpire = $GraphRequest | Where-Object -Property passwordValidityPeriodInDays -NE '2147483647'
3938

40-
If ($Settings.remediate -eq $true) {
39+
if ($Settings.remediate -eq $true) {
4140

4241
if ($DomainswithoutPassExpire) {
4342
$DomainswithoutPassExpire | ForEach-Object {
@@ -72,5 +71,11 @@ function Invoke-CIPPStandardPasswordExpireDisabled {
7271

7372
if ($Settings.report -eq $true) {
7473
Add-CIPPBPAField -FieldName 'PasswordExpireDisabled' -FieldValue $DomainswithoutPassExpire -StoreAs json -Tenant $tenant
74+
if ($DomainswithoutPassExpire) {
75+
$FieldValue = $DomainswithoutPassExpire
76+
} else {
77+
$FieldValue = $true
78+
}
79+
Set-CIPPStandardsCompareField -FieldName 'standards.PasswordExpireDisabled' -FieldValue $FieldValue -Tenant $tenant
7580
}
7681
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ function Invoke-CIPPStandardPerUserMFA {
2828
#>
2929

3030
param($Tenant, $Settings)
31-
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'PerUserMFA'
32-
3331

3432
$GraphRequest = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/users?`$top=999&`$select=userPrincipalName,displayName,accountEnabled,perUserMfaState&`$filter=userType eq 'Member' and accountEnabled eq true and displayName ne 'On-Premises Directory Synchronization Service Account'&`$count=true" -tenantid $Tenant -ComplexFilter
3533
$UsersWithoutMFA = $GraphRequest | Where-Object -Property perUserMfaState -NE 'enforced' | Select-Object -Property userPrincipalName, displayName, accountEnabled, perUserMfaState

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function Invoke-CIPPStandardPhishProtection {
1919
ADDEDDATE
2020
2024-01-22
2121
DISABLEDFEATURES
22-
22+
2323
POWERSHELLEQUIVALENT
2424
Portal only
2525
RECOMMENDEDBY
@@ -45,7 +45,7 @@ function Invoke-CIPPStandardPhishProtection {
4545
background-image: url(https://clone.cipp.app/api/PublicPhishingCheck?Tenantid=$($tenant)&URL=$($Settings.URL));
4646
}
4747
"@
48-
If ($Settings.remediate -eq $true) {
48+
if ($Settings.remediate -eq $true) {
4949

5050
try {
5151
if (!$currentBody) {
@@ -77,12 +77,13 @@ function Invoke-CIPPStandardPhishProtection {
7777
if ($currentBody -like "*$CSS*") {
7878
Write-LogMessage -API 'Standards' -tenant $tenant -message 'PhishProtection is enabled.' -sev Info
7979
} else {
80-
Write-StandardsAlert -message "PhishProtection is not enabled" -object $currentBody -tenant $tenant -standardName 'PhishProtection' -standardId $Settings.standardId
80+
Write-StandardsAlert -message 'PhishProtection is not enabled' -object $currentBody -tenant $tenant -standardName 'PhishProtection' -standardId $Settings.standardId
8181
Write-LogMessage -API 'Standards' -tenant $tenant -message 'PhishProtection is not enabled.' -sev Info
8282
}
8383
}
8484
if ($Settings.report -eq $true) {
8585
if ($currentBody -like "*$CSS*") { $authstate = $true } else { $authstate = $false }
8686
Add-CIPPBPAField -FieldName 'PhishProtection' -FieldValue $authstate -StoreAs bool -Tenant $tenant
87+
Set-CIPPStandardsCompareField -FieldName 'standards.PhishProtection' -FieldValue $authstate -Tenant $tenant
8788
}
8889
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,11 @@ function Invoke-CIPPStandardProfilePhotos {
112112

113113
if ($Settings.report -eq $true) {
114114
Add-CIPPBPAField -FieldName 'ProfilePhotos' -FieldValue $CurrentStatesCorrect -StoreAs bool -Tenant $Tenant
115+
if ($CurrentStatesCorrect) {
116+
$FieldValue = $true
117+
} else {
118+
$FieldValue = $CurrentOWAState
119+
}
120+
Set-CIPPStandardsCompareField -FieldName 'standards.ProfilePhotos' -FieldValue $FieldValue -Tenant $Tenant
115121
}
116122
}

0 commit comments

Comments
 (0)