Skip to content

Commit 0205070

Browse files
authored
Merge pull request #324 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents f353f7b + b9e62a4 commit 0205070

13 files changed

+39
-17
lines changed

Modules/CIPPCore/Public/Authentication/Test-CIPPAccess.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ function Test-CIPPAccess {
123123
}
124124

125125
$BaseRole = $null
126+
127+
if ($User.userRoles -contains 'superadmin') {
128+
$User.userRoles = @('superadmin')
129+
} elseif ($User.userRoles -contains 'admin') {
130+
$User.userRoles = @('admin')
131+
}
126132
foreach ($Role in $BaseRoles.PSObject.Properties) {
127133
foreach ($UserRole in $User.userRoles) {
128134
if ($Role.Name -eq $UserRole) {
@@ -131,6 +137,7 @@ function Test-CIPPAccess {
131137
}
132138
}
133139
}
140+
134141
}
135142

136143
# Check base role permissions before continuing to custom roles

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Users/Invoke-ExecBECRemediate.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using namespace System.Net
22

3-
Function Invoke-ExecBECRemediate {
3+
function Invoke-ExecBECRemediate {
44
<#
55
.FUNCTIONALITY
66
Entrypoint
@@ -54,7 +54,7 @@ Function Invoke-ExecBECRemediate {
5454
"Failed to disable $RuleFailed Inbox Rules for $Username"
5555
}
5656
$StatusCode = [HttpStatusCode]::OK
57-
Write-LogMessage -API 'BECRemediate' -tenant $TenantFilter -message "Executed Remediation for $Username" -sev 'Info'
57+
Write-LogMessage -API 'BECRemediate' -tenant $TenantFilter -message "Executed Remediation for $Username" -sev 'Info' -LogData @($Results)
5858

5959
} catch {
6060
$ErrorMessage = Get-CippException -Exception $_

Modules/CIPPCore/Public/GraphHelper/Get-NormalizedError.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function Get-NormalizedError {
4343
'Response status code does not indicate success: 400 (Bad Request).' { 'Error 400 occured. There is an issue with the token configuration for this tenant. Please perform an access check' }
4444
'*Microsoft.Skype.Sync.Pstn.Tnm.Common.Http.HttpResponseException*' { 'Could not connect to Teams Admin center - Tenant might be missing a Teams license' }
4545
'*Provide valid credential.*' { 'Error 400: There is an issue with your Exchange Token configuration. Please perform an access check for this tenant' }
46-
'*This indicate that a subscription within the tenant has lapsed*' { 'There is subscription for this service available, Check licensing information.' }
46+
'*This indicate that a subscription within the tenant has lapsed*' { 'There is no subscription for this service available, Check licensing information.' }
4747
'*User was not found.*' { 'The relationship between this tenant and the partner has been dissolved from the tenant side.' }
4848
'*AADSTS50020*' { 'AADSTS50020: The user you have used for your Secure Application Model is a guest in this tenant, or your are using GDAP and have not added the user to the correct group. Please delete the guest user to gain access to this tenant' }
4949
'*AADSTS50177' { 'AADSTS50177: The user you have used for your Secure Application Model is a guest in this tenant, or your are using GDAP and have not added the user to the correct group. Please delete the guest user to gain access to this tenant' }

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function Invoke-CIPPStandardExcludedfileExt {
6969
if ($Settings.alert -eq $true) {
7070

7171
if ($MissingExclusions) {
72+
Write-StandardsAlert -message 'Exclude File Extensions from Syncing missing some extensions.' -object $MissingExclusions -tenant $Tenant -standardName 'ExcludedfileExt' -standardId $Settings.standardId
7273
Write-LogMessage -API 'Standards' -tenant $tenant -message "Excluded synced files does not contain $($MissingExclusions -join ',')" -sev Alert
7374
} else {
7475
Write-LogMessage -API 'Standards' -tenant $tenant -message "Excluded synced files contains $($Settings.ext)" -sev Info

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ function Invoke-CIPPStandardQuarantineRequestAlert {
7878
if ($StateIsCorrect -eq $true) {
7979
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'Quarantine Request Alert is enabled' -sev Info
8080
} else {
81-
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'Quarantine Request Alert is disabled' -sev Info
81+
$Message = 'Quarantine Request Alert is not enabled.'
82+
Write-StandardsAlert -message $Message -object $CurrentState -tenant $Tenant -standardName 'QuarantineRequestAlerts' -standardId $Settings.standardId
83+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message $Message -sev Info
8284
}
8385
}
8486

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ function Invoke-CIPPStandardSPAzureB2B {
5858
if ($StateIsCorrect -eq $true) {
5959
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'SharePoint Azure B2B is enabled' -Sev Info
6060
} else {
61-
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'SharePoint Azure B2B is not enabled' -Sev Alert
61+
$Message = 'SharePoint Azure B2B is not enabled.'
62+
Write-StandardsAlert -message $Message -object $CurrentState -tenant $Tenant -standardName 'SPAzureB2B' -standardId $Settings.standardId
63+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message $Message -Sev Alert
6264
}
6365
}
6466

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,29 @@ function Invoke-CIPPStandardSPDirectSharing {
3939

4040
if ($Settings.remediate -eq $true) {
4141
if ($StateIsCorrect -eq $true) {
42-
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'SharePoint Sharing Restriction is already enabled' -Sev Info
42+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'SharePoint Default Direct Sharing is already enabled' -Sev Info
4343
} else {
4444
$Properties = @{
4545
DefaultSharingLinkType = 1
4646
}
4747

4848
try {
4949
Get-CIPPSPOTenant -TenantFilter $Tenant | Set-CIPPSPOTenant -Properties $Properties
50-
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'Successfully set the SharePoint Sharing Restriction to Direct' -Sev Info
50+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'Successfully set the SharePoint Default Direct Sharing to Direct' -Sev Info
5151
} catch {
5252
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message
53-
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message "Failed to set the SharePoint Sharing Restriction to Direct. Error: $ErrorMessage" -Sev Error
53+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message "Failed to set the SharePoint Default Direct Sharing to Direct. Error: $ErrorMessage" -Sev Error
5454
}
5555
}
5656
}
5757

5858
if ($Settings.alert -eq $true) {
5959
if ($StateIsCorrect -eq $true) {
60-
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'SharePoint Sharing Restriction is enabled' -Sev Info
60+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'SharePoint Direct Sharing is enabled' -Sev Info
6161
} else {
62-
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'SharePoint Sharing Restriction is not enabled' -Sev Alert
62+
$Message = 'SharePoint Default Direct Sharing is not enabled.'
63+
Write-StandardsAlert -message $Message -object $CurrentState -tenant $Tenant -standardName 'SPDirectSharing' -standardId $Settings.standardId
64+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message $Message -Sev Alert
6365
}
6466
}
6567

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ function Invoke-CIPPStandardSPDisableLegacyWorkflows {
5757

5858
if ($Settings.alert -eq $true) {
5959
if ($StateIsCorrect -eq $true) {
60-
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'Legacy Workflows are disabled' -Sev Info
60+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'SharePoint Legacy Workflows are disabled' -Sev Info
6161
} else {
62-
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'Legacy Workflows are enabled' -Sev Info
62+
$Message = 'SharePoint Legacy Workflows is not disabled.'
63+
Write-StandardsAlert -message $Message -object $CurrentState -tenant $Tenant -standardName 'SPDisableLegacyWorkflows' -standardId $Settings.standardId
64+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message $Message -Sev Info
6365
}
6466
}
6567

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ function Invoke-CIPPStandardSPDisallowInfectedFiles {
5959
if ($StateIsCorrect -eq $true) {
6060
Write-LogMessage -API 'Standards' -tenant $tenant -Message 'Downloading SharePoint infected files are disallowed.' -Sev Info
6161
} else {
62-
Write-LogMessage -API 'Standards' -tenant $tenant -Message 'Downloading SharePoint infected files are allowed.' -Sev Alert
62+
$Message = 'Downloading SharePoint infected files is not set to the desired value.'
63+
Write-StandardsAlert -message $Message -object $CurrentState -tenant $Tenant -standardName 'SPDisallowInfectedFiles' -standardId $Settings.standardId
64+
Write-LogMessage -API 'Standards' -tenant $tenant -Message $Message -Sev Alert
6365
}
6466
}
6567

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ function Invoke-CIPPStandardSPEmailAttestation {
6666
if ($StateIsCorrect -eq $true) {
6767
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'Re-authentication with verification code is restricted.' -Sev Info
6868
} else {
69-
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'Re-authentication with verification code is not restricted.' -Sev Alert
69+
$Message = 'Re-authentication with verification code is not set to the desired value.'
70+
Write-StandardsAlert -message $Message -object $CurrentState -tenant $Tenant -standardName 'SPEmailAttestation' -standardId $Settings.standardId
71+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message $Message -Sev Alert
7072
}
7173
}
7274

0 commit comments

Comments
 (0)