Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit log tweaks #1042

Merged
merged 5 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ function Invoke-ListAuditLogs {
if ($Request.Query.LogId) {
$FilterConditions.Add("RowKey eq '$($Request.Query.LogId)'")
} else {
if ($TenantFilter) {
if ($TenantFilter -and $TenantFilter -ne 'AllTenants') {
$FilterConditions.Add("Tenant eq '$TenantFilter'")
}

if (!$Request.Query.StartDate -and !$Request.Query.EndDate -and !$Request.Query.RelativeTime) {
$Request.Query.StartDate = (Get-Date).AddDays(-1).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ')
$Request.Query.EndDate = (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ')
}

if ($Request.Query.RelativeTime) {
$RelativeTime = $Request.Query.RelativeTime

Expand Down
2 changes: 1 addition & 1 deletion Modules/CIPPCore/Public/Send-CIPPAlert.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function Send-CIPPAlert {
try {
$Table = Get-CIPPTable -TableName $TableName
$Alert = @{
PartitionKey = 'Alert'
PartitionKey = $TenantFilter ?? 'Alert'
RowKey = [string][guid]::NewGuid()
Title = $Title
Data = [string]$JSONContent
Expand Down
2 changes: 1 addition & 1 deletion Modules/CIPPCore/Public/Set-CIPPSAMAdminRoles.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function Set-CIPPSAMAdminRoles {
$null = New-ExoRequest -cmdlet 'New-ServicePrincipal' -cmdParams @{AppId = $env:ApplicationId; ObjectId = $id; DisplayName = 'CIPP-SAM' } -tenantid $TenantFilter -useSystemMailbox $true -AsApp
$ActionLogs.Add('Added Service Principal to Exchange Online')
} catch {
$ActionLogs.Add('Service Principal alrady added to Exchange Online')
$ActionLogs.Add('Service Principal already added to Exchange Online')
}

Write-Verbose ($Requests | ConvertTo-Json -Depth 5)
Expand Down