Skip to content

Commit 80b802a

Browse files
authored
Merge pull request #127 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 5950eac + bb3ecd3 commit 80b802a

File tree

7 files changed

+36
-11
lines changed

7 files changed

+36
-11
lines changed

Config/CyberEssentials.BPATemplate.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@
9292
"isMFARegistered",
9393
"defaultMFAMethod"
9494
],
95-
"URL": "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails"
95+
"URL": "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails",
96+
"Parameters": {
97+
"asApp": "True"
98+
}
9699
}
97100
]
98101
}

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertMFAAdmins.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function Get-CIPPAlertMFAAdmins {
1818
}
1919
}
2020
if (!$DuoActive) {
21-
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq true and isMfaRegistered eq false and userType eq 'member'&`$select=userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
21+
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq true and isMfaRegistered eq false and userType eq 'member'&`$select=userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) -AsApp $true | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
2222
if ($users.UserPrincipalName) {
2323
$AlertData = "The following admins do not have MFA registered: $($users.UserPrincipalName -join ', ')"
2424
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertMFAAlertUsers.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Get-CIPPAlertMFAAlertUsers {
1212
)
1313
try {
1414

15-
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq false and isMfaRegistered eq false and userType eq 'member'&`$select=userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
15+
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq false and isMfaRegistered eq false and userType eq 'member'&`$select=userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) -AsApp $true | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
1616
if ($users.UserPrincipalName) {
1717
$AlertData = "The following $($users.Count) users do not have MFA registered: $($users.UserPrincipalName -join ', ')"
1818
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData

Modules/CIPPCore/Public/Entrypoints/Orchestrator Functions/Start-AuditLogSearchCreation.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function Start-AuditLogSearchCreation {
77
param()
88
try {
99
$ConfigTable = Get-CippTable -TableName 'WebhookRules'
10-
$ConfigEntries = Get-CIPPAzDataTableEntity @ConfigTable
10+
$ConfigEntries = Get-CIPPAzDataTableEntity @ConfigTable -Filter "PartitionKey eq 'Webhookv2'"
1111

1212
$TenantList = Get-Tenants -IncludeErrors
1313
# Round time down to nearest minute

Modules/CIPPCore/Public/Entrypoints/Orchestrator Functions/Start-BPAOrchestrator.ps1

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,32 @@ function Start-BPAOrchestrator {
3030
}
3131

3232
Write-Verbose 'Getting BPA templates'
33+
34+
3335
$BPATemplateTable = Get-CippTable -tablename 'templates'
3436
$Filter = "PartitionKey eq 'BPATemplate'"
35-
$Templates = ((Get-CIPPAzDataTableEntity @BPATemplateTable -Filter $Filter).JSON | ConvertFrom-Json).Name
37+
try {
38+
$TemplateRows = Get-CIPPAzDataTableEntity @BPATemplateTable -Filter $Filter
39+
40+
if (!$TemplateRows) {
41+
$null = Get-ChildItem 'Config\*.BPATemplate.json' | ForEach-Object {
42+
$TemplateJson = Get-Content $_ | ConvertFrom-Json | ConvertTo-Json -Compress -Depth 10
43+
$Entity = @{
44+
JSON = "$TemplateJson"
45+
RowKey = "$($_.name)"
46+
PartitionKey = 'BPATemplate'
47+
GUID = "$($_.name)"
48+
}
49+
Add-CIPPAzDataTableEntity @Table -Entity $Entity -Force
50+
}
51+
$TemplateRows = Get-CIPPAzDataTableEntity @BPATemplateTable -Filter $Filter
52+
}
3653

54+
$Templates = ($TemplateRows.JSON | ConvertFrom-Json).Name
55+
} catch {
56+
Write-LogMessage -API 'BestPracticeAnalyser' -message 'Could not get BPA templates' -sev Error
57+
return $false
58+
}
3759
Write-Verbose 'Creating orchestrator batch'
3860
$BPAReports = foreach ($Tenant in $TenantList) {
3961
foreach ($Template in $Templates) {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function Invoke-CIPPStandardDisableBasicAuthSMTP {
77
.SYNOPSIS
88
(Label) Disable SMTP Basic Authentication
99
.DESCRIPTION
10-
(Helptext) Disables SMTP AUTH for the organization and all users. This is the default for new tenants.
10+
(Helptext) Disables SMTP AUTH for the organization and all users. This is the default for new tenants.
1111
(DocsDescription) Disables SMTP basic authentication for the tenant and all users with it explicitly enabled.
1212
.NOTES
1313
CAT
@@ -75,24 +75,24 @@ function Invoke-CIPPStandardDisableBasicAuthSMTP {
7575
if ($SMTPusers.Count -eq 0) {
7676
$LogMessage.add('SMTP Basic Authentication for all users is disabled')
7777
} else {
78-
$LogMessage.add("SMTP Basic Authentication for the following $($SMTPusers.Count) users is not disabled: $($SMTPusers.PrimarySmtpAddress -join ',')")
78+
$LogMessage.add("SMTP Basic Authentication for the following $($SMTPusers.Count) users is not disabled: $($SMTPusers.PrimarySmtpAddress -join ', ')")
7979
}
8080

8181
if ($Settings.alert -eq $true) {
8282

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-LogMessage -API 'Standards' -tenant $tenant -message $LogMessage -sev Alert
86+
Write-LogMessage -API 'Standards' -tenant $tenant -message ($LogMessage -join '') -sev Alert
8787
}
8888
}
8989

9090
if ($Settings.report -eq $true) {
91-
9291
if ($CurrentInfo.SmtpClientAuthenticationDisabled -and $SMTPusers.Count -eq 0) {
9392
Add-CIPPBPAField -FieldName 'DisableBasicAuthSMTP' -FieldValue $CurrentInfo.SmtpClientAuthenticationDisabled -StoreAs bool -Tenant $tenant
9493
} else {
95-
Add-CIPPBPAField -FieldName 'DisableBasicAuthSMTP' -FieldValue $LogMessage -StoreAs string -Tenant $tenant
94+
$Logs = $LogMessage | Select-Object @{n = 'Message'; e = { $_ } }
95+
Add-CIPPBPAField -FieldName 'DisableBasicAuthSMTP' -FieldValue $Logs -StoreAs json -Tenant $tenant
9696
}
9797
}
9898
}

Modules/CippExtensions/Public/PwPush/New-PwPushLink.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function New-PwPushLink {
1919
if ($PSCmdlet.ShouldProcess('Create a new PwPush link')) {
2020
$Link = New-Push @PushParams
2121
if ($Configuration.RetrievalStep) {
22-
return $Link.LinkRetrievalStep
22+
return $Link.LinkRetrievalStep -replace '/r/r', '/r'
2323
}
2424
return $Link.Link
2525
}

0 commit comments

Comments
 (0)