Skip to content

Commit cf66039

Browse files
committed
Silly audit logs
1 parent 78eb1ae commit cf66039

3 files changed

Lines changed: 6 additions & 20 deletions

File tree

Modules/CIPPActivityTriggers/Public/Entrypoints/Activity Triggers/Webhooks/Push-AuditLogSearchCreation.ps1

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@ function Push-AuditLogSearchCreation {
1010
$Tenant = $Item.Tenant
1111
$StartTime = $Item.StartTime
1212
$EndTime = $Item.EndTime
13-
$ServiceFilters = @($Item.ServiceFilters)
14-
1513
try {
1614
$LogSearch = @{
1715
StartTime = $StartTime
1816
EndTime = $EndTime
19-
ServiceFilters = $ServiceFilters
2017
TenantFilter = $Tenant.defaultDomainName
2118
ProcessLogs = $true
2219
RecordTypeFilters = @(

Modules/CIPPCore/Public/AuditLogs/New-CippAuditLogSearch.ps1

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ function New-CippAuditLogSearch {
1616
The record types to filter on.
1717
.PARAMETER KeywordFilter
1818
The keyword to filter on.
19-
.PARAMETER ServiceFilter
20-
The service to filter on.
2119
.PARAMETER OperationsFilters
2220
The operations to filter on.
2321
.PARAMETER UserPrincipalNameFilters
@@ -109,8 +107,6 @@ function New-CippAuditLogSearch {
109107
[Parameter()]
110108
[string]$KeywordFilters,
111109
[Parameter()]
112-
[string[]]$ServiceFilters,
113-
[Parameter()]
114110
[string[]]$OperationsFilters,
115111
[Parameter()]
116112
[string[]]$UserPrincipalNameFilters,
@@ -138,9 +134,6 @@ function New-CippAuditLogSearch {
138134
if ($KeywordFilters) {
139135
$SearchParams.keywordFilter = $KeywordFilters
140136
}
141-
if ($ServiceFilters) {
142-
$SearchParams.serviceFilters = @($ServiceFilters)
143-
}
144137
if ($UserPrincipalNameFilters) {
145138
$SearchParams.userPrincipalNameFilters = @($UserPrincipalNameFilters)
146139
}

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,29 +68,25 @@ function Start-AuditLogSearchCreation {
6868
}
6969

7070
$TenantInConfig = $false
71-
$MatchingConfigs = [System.Collections.Generic.List[object]]::new()
7271
foreach ($ConfigEntry in $ConfigEntries) {
7372
if ($ConfigEntry.excludedTenants.value -contains $Tenant.defaultDomainName) {
7473
continue
7574
}
7675
if ($ConfigEntry.ExpandedTenants -contains $Tenant.defaultDomainName -or $ConfigEntry.ExpandedTenants -contains 'AllTenants') {
7776
$TenantInConfig = $true
78-
$MatchingConfigs.Add($ConfigEntry)
77+
break
7978
}
8079
}
8180

8281
if (!$TenantInConfig) {
8382
continue
8483
}
8584

86-
if ($MatchingConfigs) {
87-
[PSCustomObject]@{
88-
FunctionName = 'AuditLogSearchCreation'
89-
Tenant = $Tenant | Select-Object defaultDomainName, customerId, displayName
90-
StartTime = $StartTime
91-
EndTime = $EndTime
92-
ServiceFilters = @($MatchingConfigs | Select-Object -Property type | Sort-Object -Property type -Unique | ForEach-Object { $_.type.split('.')[1] })
93-
}
85+
[PSCustomObject]@{
86+
FunctionName = 'AuditLogSearchCreation'
87+
Tenant = $Tenant | Select-Object defaultDomainName, customerId, displayName
88+
StartTime = $StartTime
89+
EndTime = $EndTime
9490
}
9591
}
9692

0 commit comments

Comments
 (0)