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

improve performance of Defender query to count users without advanced auditing #1406

Merged
Merged
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 @@ -143,13 +143,13 @@ function Export-DefenderProvider {
$DLPLicense = ConvertTo-Json $false
}

# Run commands to get count of users with Advanced auditing enabled
# Get count of users without Advanced auditing enabled
# GUID below is service plan ID for M365_ADVANCED_AUDITING as defined
# on Microsoft Licensing Reference shown here:
# https://learn.microsoft.com/en-us/entra/identity/users/licensing-service-plan-reference
$UserParameters = @{ConsistencyLevel = 'eventual'
Count = 'UsersWithoutAdvancedAuditCount'
All = $true
Top = 1
Filter = "not assignedPlans/any(a:a/servicePlanId eq 2f442157-a11c-46b9-ae5b-6e39ff4e5849 and a/capabilityStatus eq 'Enabled')"
}

Expand Down
Loading