Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
59a084a
Add tenant offboarding defaults API and listing support
Zacgoose Aug 14, 2025
cf728aa
Add Power Platform and Power BI portal links
Zacgoose Aug 19, 2025
1ca079e
HVE and shared mailbox drawer.
KelvinTegelaar Aug 21, 2025
73f75c8
alert on licensed users with roles
KelvinTegelaar Aug 21, 2025
d3003b7
filter standardscompare list
JohnDuprey Aug 21, 2025
6b3b9cb
filter tenant alignment
JohnDuprey Aug 21, 2025
604e754
add ps version to version table
JohnDuprey Aug 21, 2025
765395c
prevent one corrupted template from breaking list
JohnDuprey Aug 21, 2025
bb28ca8
audit log search improvements
JohnDuprey Aug 21, 2025
88c0ff0
fix pagination issues with alltenants queries
JohnDuprey Aug 21, 2025
7a60c9d
add support for querying specific queue id
JohnDuprey Aug 21, 2025
4864470
fix timestamps
JohnDuprey Aug 21, 2025
5064118
Update Invoke-ListCippQueue.ps1
JohnDuprey Aug 21, 2025
be2db2f
fix forever loading bug by not waiting for all tenants before reporti…
JohnDuprey Aug 21, 2025
dd57785
add queue id to other long running api calls
JohnDuprey Aug 21, 2025
95ddb00
WAAttachmentRestrictions
KelvinTegelaar Aug 22, 2025
8b38f85
info logging tweak
JohnDuprey Aug 22, 2025
af8f675
optimize partition keys
JohnDuprey Aug 22, 2025
b817b4f
add better queue filtering
JohnDuprey Aug 22, 2025
a9ed400
nested column selection for graph explorer
JohnDuprey Aug 22, 2025
dc3dcf8
Merge pull request #1590 from Zacgoose/power-portal-links-configurabl…
KelvinTegelaar Aug 22, 2025
d367e16
variable expansion improvements
JohnDuprey Aug 22, 2025
4adc53a
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
JohnDuprey Aug 22, 2025
cdc5b0f
Merge pull request #1588 from Zacgoose/tenant-default-offboarding
KelvinTegelaar Aug 22, 2025
88bfdc9
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
JohnDuprey Aug 22, 2025
46f5fd2
add cippurl replacement
JohnDuprey Aug 22, 2025
60fea48
add defaultdomain
JohnDuprey Aug 22, 2025
846df85
Improvements to rule management for tenants
KelvinTegelaar Aug 22, 2025
72aba48
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Aug 22, 2025
3842bad
Feat: Contact Permissions Management
Zacgoose Aug 26, 2025
3921be4
Feat: Remove deprecated add-ins for "Report Phishing" and "Report Mes…
Zacgoose Aug 26, 2025
314d900
Update openapi spec
Zacgoose Aug 26, 2025
f8d63a2
Feat: Add Invoke-ExecSyncVPP function for VPP token synchronization
kris6673 Aug 28, 2025
53248f3
Feat: add MDO/Email & collaboration alerts API
kris6673 Aug 29, 2025
fb6d624
Refactor BitLocker key functions for to return ID and implement logging
kris6673 Aug 30, 2025
ec10426
Fix: Add ExternalAudience param based on input
kris6673 Aug 30, 2025
be8b9c8
Fix: Add GOV exchange licenses to the standards license check
kris6673 Aug 30, 2025
1efd391
Merge pull request #1602 from kris6673/issue4576
KelvinTegelaar Sep 1, 2025
8b00cfa
Merge pull request #1604 from kris6673/issue4567
KelvinTegelaar Sep 1, 2025
c9fb5ce
Merge pull request #1603 from kris6673/issue4582
KelvinTegelaar Sep 1, 2025
a90ee2f
Merge pull request #1600 from kris6673/vpp-sync
KelvinTegelaar Sep 1, 2025
79c866c
Merge pull request #1599 from Zacgoose/outlookaddins
KelvinTegelaar Sep 1, 2025
850af4f
Merge pull request #1601 from kris6673/email-alerts
KelvinTegelaar Sep 1, 2025
6e39967
batch $expand support
JohnDuprey Sep 2, 2025
123f280
Fix: Fix AP profile assignment bug from bad comparison
kris6673 Sep 2, 2025
93efece
prevent null from being returned
JohnDuprey Sep 2, 2025
7b469c1
Feat: Add Invoke-RemoveAutopilotConfig and Remove-CIPPAutopilotProfil…
kris6673 Sep 2, 2025
8653614
Merge pull request #1606 from kris6673/ap-profile-actions
KelvinTegelaar Sep 2, 2025
10cd5ae
Merge pull request #1605 from kris6673/fix-ap-profile-all-devices
KelvinTegelaar Sep 2, 2025
c0b83b6
Merge pull request #1598 from Zacgoose/contact_perms
KelvinTegelaar Sep 2, 2025
1e0a3d6
prevent malformed audit log rule from breaking processing
JohnDuprey Sep 2, 2025
3d2cf1c
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
JohnDuprey Sep 2, 2025
2aa5f78
Fix: Add logic handling setting MFA for guests
kris6673 Sep 3, 2025
ad614e7
Merge pull request #1607 from kris6673/issue4591
KelvinTegelaar Sep 3, 2025
90940fa
batch expand for assignedLicenses
JohnDuprey Sep 4, 2025
fbe5f33
only skip exchange groups if not licensed
JohnDuprey Sep 4, 2025
5bc11f1
force orchestrator id to be string
JohnDuprey Sep 4, 2025
d7e8d8c
fix member query
JohnDuprey Sep 5, 2025
898ab21
Add null checks to mailbox quota alert
Zacgoose Sep 5, 2025
815cb33
Merge pull request #1608 from Zacgoose/quota-alert
JohnDuprey Sep 5, 2025
d4bf4a6
add follow up command to update dynamic group for sender auth
JohnDuprey Sep 5, 2025
4d1e338
add initialDomainName to tenantfilter
JohnDuprey Sep 6, 2025
daa1ca9
handle new alert format for phishing check
JohnDuprey Sep 6, 2025
eff059a
fix odata
JohnDuprey Sep 6, 2025
baa198d
Deployment group templates fix
KelvinTegelaar Sep 7, 2025
ce08eb4
backoff logic
KelvinTegelaar Sep 7, 2025
bffce6c
Changes
KelvinTegelaar Sep 7, 2025
2ae5068
rate limiting in user tasks
JohnDuprey Sep 7, 2025
3748387
fix display name retrieval
KelvinTegelaar Sep 7, 2025
3e6d1ba
allow array
KelvinTegelaar Sep 7, 2025
e55f664
CIS Templates
KelvinTegelaar Sep 8, 2025
9c13efd
updated community repos
KelvinTegelaar Sep 8, 2025
8567bf9
refactor: use splatting
kris6673 Sep 8, 2025
b9eecf2
Merge pull request #1609 from kris6673/esp-fix
JohnDuprey Sep 8, 2025
12b53e9
feat: enhance Autopilot Status Page settings with new options and com…
kris6673 Sep 8, 2025
1f3fc8f
Merge pull request #1610 from kris6673/brainfart
KelvinTegelaar Sep 8, 2025
8e7f847
chore: refactor groups/group templates
JohnDuprey Sep 8, 2025
1de164f
fix double logging
JohnDuprey Sep 8, 2025
a292ead
fix issue with activity function returning $true
JohnDuprey Sep 10, 2025
a44cb7b
Add package ability
KelvinTegelaar Sep 10, 2025
d2c8357
Update CippEntrypoints.psm1
JohnDuprey Sep 10, 2025
9a61b67
fix issue with state changes on CA deployment
JohnDuprey Sep 12, 2025
cba5f92
add tag support
KelvinTegelaar Sep 12, 2025
cf3a355
blocked endpoint support
JohnDuprey Sep 12, 2025
de99211
new tags
KelvinTegelaar Sep 12, 2025
86b2b69
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Sep 12, 2025
d007fa2
up version
KelvinTegelaar Sep 12, 2025
b27da21
Merge pull request #1611 from KelvinTegelaar/dev
KelvinTegelaar Sep 12, 2025
c82ca67
fix combined setup
JohnDuprey Sep 12, 2025
567c049
Merge pull request #1612 from KelvinTegelaar/dev
JohnDuprey Sep 12, 2025
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
36 changes: 36 additions & 0 deletions CommunityRepos.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
[
{
"Id": "1041442982",
"Name": "CISTemplates",
"Description": "CIPP CIS Templates",
"URL": "https://github.com/CyberDrain/CyberDrain-CIS-Templates",
"FullName": "CyberDrain/CyberDrain-CIS-Templates",
"Owner": "CyberDrain",
"Visibility": "public",
"WriteAccess": false,
"DefaultBranch": "main",
"RepoPermissions": {
"admin": false,
"maintain": false,
"push": false,
"triage": false,
"pull": true
}
},
{
"Id": "930523724",
"Name": "CIPP-Templates",
Expand Down Expand Up @@ -52,5 +70,23 @@
"triage": false,
"pull": true
}
},
{
"Id": "863076113",
"Name": "IntuneBaseLines",
"Description": "In this repo, you will find Intune profiles in JSON format, which can be used in setting up your Modern Workplace. All policies were created in Microsoft Intune and exported to share with the community.",
"URL": "https://github.com/IntuneAdmin/IntuneBaselines",
"FullName": "IntuneAdmin/IntuneBaselines",
"Owner": "IntuneAdmin",
"Visibility": "public",
"WriteAccess": false,
"DefaultBranch": "main",
"RepoPermissions": {
"admin": false,
"maintain": false,
"push": false,
"triage": false,
"pull": true
}
}
]
10 changes: 10 additions & 0 deletions Config/SchedulerRateLimits.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"Command": "Sync-CIPPExtensionData",
"MaxRequests": 50
},
{
"Command": "Push-CIPPExtensionData",
"MaxRequests": 30
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
function Get-CIPPAlertLicensedUsersWithRoles {
<#
.FUNCTIONALITY
Entrypoint
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $false)]
[Alias('input')]
$InputValue,
$TenantFilter
)

# Get all users with assigned licenses
$LicensedUsers = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/users?`$top=999&`$select=userPrincipalName,assignedLicenses,displayName" -tenantid $TenantFilter | Where-Object { $_.assignedLicenses -and $_.assignedLicenses.Count -gt 0 }
if (-not $LicensedUsers -or $LicensedUsers.Count -eq 0) {
Write-Information "No licensed users found for tenant $TenantFilter"
return $true
}
# Get all directory roles with their members
$DirectoryRoles = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/directoryRoles?`$expand=members" -tenantid $TenantFilter
if (-not $DirectoryRoles -or $DirectoryRoles.Count -eq 0) {
Write-Information "No directory roles found for tenant $TenantFilter"
return
}
$UsersToAlertOn = $LicensedUsers | Where-Object { $_.userPrincipalName -in $DirectoryRoles.members.userPrincipalName }


if ($UsersToAlertOn.Count -gt 0) {
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $UsersToAlertOn
} else {
Write-Information "No licensed users with roles found for tenant $TenantFilter"
}


}
2 changes: 1 addition & 1 deletion Modules/CIPPCore/Public/Alerts/Get-CIPPAlertQuotaUsed.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Get-CIPPAlertQuotaUsed {
return
}
$OverQuota = $AlertData | ForEach-Object {
if ($_.StorageUsedInBytes -eq 0 -or $_.prohibitSendReceiveQuotaInBytes -eq 0) { return }
if ([string]::IsNullOrEmpty($_.StorageUsedInBytes) -or [string]::IsNullOrEmpty($_.prohibitSendReceiveQuotaInBytes) -or $_.StorageUsedInBytes -eq 0 -or $_.prohibitSendReceiveQuotaInBytes -eq 0) { return }
try {
$PercentLeft = [math]::round(($_.storageUsedInBytes / $_.prohibitSendReceiveQuotaInBytes) * 100)
} catch { $PercentLeft = 100 }
Expand Down
34 changes: 19 additions & 15 deletions Modules/CIPPCore/Public/AuditLogs/Get-CippAuditLogSearches.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,31 @@ function Get-CippAuditLogSearches {
[Parameter()]
[switch]$ReadyToProcess
)

$AuditLogSearchesTable = Get-CippTable -TableName 'AuditLogSearches'
if ($ReadyToProcess.IsPresent) {
$AuditLogSearchesTable = Get-CippTable -TableName 'AuditLogSearches'
$15MinutesAgo = (Get-Date).AddMinutes(-15).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ')
$1DayAgo = (Get-Date).AddDays(-1).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ')
$PendingQueries = Get-CIPPAzDataTableEntity @AuditLogSearchesTable -Filter "Tenant eq '$TenantFilter' and (CippStatus eq 'Pending' or (CippStatus eq 'Processing' and Timestamp le datetime'$15MinutesAgo')) and Timestamp ge datetime'$1DayAgo'" | Sort-Object Timestamp
$PendingQueries = Get-CIPPAzDataTableEntity @AuditLogSearchesTable -Filter "PartitionKey eq 'Search' and Tenant eq '$TenantFilter' and (CippStatus eq 'Pending' or (CippStatus eq 'Processing' and Timestamp le datetime'$15MinutesAgo')) and Timestamp ge datetime'$1DayAgo'" | Sort-Object Timestamp
} else {
$7DaysAgo = (Get-Date).AddDays(-7).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ')
$PendingQueries = Get-CIPPAzDataTableEntity @AuditLogSearchesTable -Filter "Tenant eq '$TenantFilter' and Timestamp ge datetime'$7DaysAgo'"
}

$BulkRequests = foreach ($PendingQuery in $PendingQueries) {
@{
id = $PendingQuery.RowKey
url = 'security/auditLog/queries/' + $PendingQuery.RowKey
method = 'GET'
}
$BulkRequests = foreach ($PendingQuery in $PendingQueries) {
@{
id = $PendingQuery.RowKey
url = 'security/auditLog/queries/' + $PendingQuery.RowKey
method = 'GET'
}
if ($BulkRequests.Count -eq 0) {
return @()
}
$Queries = New-GraphBulkRequest -Requests @($BulkRequests) -AsApp $true -TenantId $TenantFilter | Select-Object -ExpandProperty body
}
if ($BulkRequests.Count -eq 0) {
return @()
}
$Queries = New-GraphBulkRequest -Requests @($BulkRequests) -AsApp $true -TenantId $TenantFilter | Select-Object -ExpandProperty body

if ($ReadyToProcess.IsPresent) {
$Queries = $Queries | Where-Object { $PendingQueries.RowKey -contains $_.id -and $_.status -eq 'succeeded' }
} else {
$Queries = New-GraphGetRequest -uri 'https://graph.microsoft.com/beta/security/auditLog/queries' -AsApp $true -tenantid $TenantFilter
}

return $Queries
}
30 changes: 18 additions & 12 deletions Modules/CIPPCore/Public/AuditLogs/New-CippAuditLogSearch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,26 @@ function New-CippAuditLogSearch {
if ($PSCmdlet.ShouldProcess('Create a new audit log search for tenant ' + $TenantFilter)) {
$Query = New-GraphPOSTRequest -uri 'https://graph.microsoft.com/beta/security/auditLog/queries' -body ($SearchParams | ConvertTo-Json -Compress) -tenantid $TenantFilter -AsApp $true


if ($ProcessLogs.IsPresent -and $Query.id) {
$Entity = [PSCustomObject]@{
PartitionKey = [string]'Search'
RowKey = [string]$Query.id
Tenant = [string]$TenantFilter
DisplayName = [string]$DisplayName
StartTime = [datetime]$StartTime.ToUniversalTime()
EndTime = [datetime]$EndTime.ToUniversalTime()
Query = [string]($Query | ConvertTo-Json -Compress)
CippStatus = [string]'Pending'
}
$Table = Get-CIPPTable -TableName 'AuditLogSearches'
Add-CIPPAzDataTableEntity @Table -Entity $Entity -Force | Out-Null
$CippStatus = 'Pending'
} else {
$CippStatus = 'N/A'
}

$Entity = [PSCustomObject]@{
PartitionKey = [string]'Search'
RowKey = [string]$Query.id
Tenant = [string]$TenantFilter
DisplayName = [string]$DisplayName
StartTime = [datetime]$StartTime.ToUniversalTime()
EndTime = [datetime]$EndTime.ToUniversalTime()
Query = [string]($Query | ConvertTo-Json -Compress)
CippStatus = [string]$CippStatus
}
$Table = Get-CIPPTable -TableName 'AuditLogSearches'
Add-CIPPAzDataTableEntity @Table -Entity $Entity -Force | Out-Null

return $Query
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ function Get-CIPPRolePermissions {
$Permissions = $Role.Permissions | ConvertFrom-Json
$AllowedTenants = if ($Role.AllowedTenants) { $Role.AllowedTenants | ConvertFrom-Json } else { @() }
$BlockedTenants = if ($Role.BlockedTenants) { $Role.BlockedTenants | ConvertFrom-Json } else { @() }
$BlockedEndpoints = if ($Role.BlockedEndpoints) { $Role.BlockedEndpoints | ConvertFrom-Json } else { @() }
[PSCustomObject]@{
Role = $Role.RowKey
Permissions = $Permissions.PSObject.Properties.Value
AllowedTenants = @($AllowedTenants)
BlockedTenants = @($BlockedTenants)
Role = $Role.RowKey
Permissions = $Permissions.PSObject.Properties.Value
AllowedTenants = @($AllowedTenants)
BlockedTenants = @($BlockedTenants)
BlockedEndpoints = @($BlockedEndpoints)
}
} else {
throw "Role $RoleName not found."
Expand Down
4 changes: 4 additions & 0 deletions Modules/CIPPCore/Public/Authentication/Test-CIPPAccess.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ function Test-CIPPAccess {
continue
}
}

if ($PermissionsFound) {
if ($TenantList.IsPresent) {
$LimitedTenantList = foreach ($Permission in $PermissionSet) {
Expand Down Expand Up @@ -248,6 +249,9 @@ function Test-CIPPAccess {
foreach ($Role in $PermissionSet) {
foreach ($Perm in $Role.Permissions) {
if ($Perm -match $APIRole) {
if ($Role.BlockedEndpoints -contains $Request.Params.CIPPEndpoint) {
throw "Access to this CIPP API endpoint is not allowed, the custom role '$($Role.Role)' has blocked this endpoint: $($Request.Params.CIPPEndpoint)"
}
$APIAllowed = $true
break
}
Expand Down
22 changes: 17 additions & 5 deletions Modules/CIPPCore/Public/CippQueue/Invoke-ListCippQueue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,32 @@ function Invoke-ListCippQueue {
.ROLE
CIPP.Core.Read
#>
param($Request = $null, $TriggerMetadata = $null)
param($Request = $null, $TriggerMetadata = $null, $Reference = $null, $QueueId = $null)

if ($Request) {
$APIName = $Request.Params.CIPPEndpoint
Write-LogMessage -headers $Request.Headers -API $APINAME -message 'Accessed this API' -Sev 'Debug'
}

$QueueId = $Request.Query.QueueId ?? $QueueId
$Reference = $Request.Query.Reference ?? $Reference

$CippQueue = Get-CippTable -TableName 'CippQueue'
$CippQueueTasks = Get-CippTable -TableName 'CippQueueTasks'
$3HoursAgo = (Get-Date).ToUniversalTime().AddHours(-3).ToString('yyyy-MM-ddTHH:mm:ssZ')
$CippQueueData = Get-CIPPAzDataTableEntity @CippQueue -Filter "PartitionKey eq 'CippQueue' and Timestamp ge datetime'$3HoursAgo'" | Sort-Object -Property Timestamp -Descending

if ($QueueId) {
$Filter = "PartitionKey eq 'CippQueue' and RowKey eq '$QueueId'"
} elseif ($Reference) {
$Filter = "PartitionKey eq 'CippQueue' and Reference eq '$Reference' and Timestamp ge datetime'$3HoursAgo'"
} else {
$Filter = "PartitionKey eq 'CippQueue' and Timestamp ge datetime'$3HoursAgo'"
}

$CippQueueData = Get-CIPPAzDataTableEntity @CippQueue -Filter $Filter | Sort-Object -Property Timestamp -Descending

$QueueData = foreach ($Queue in $CippQueueData) {
$Tasks = Get-CIPPAzDataTableEntity @CippQueueTasks -Filter "PartitionKey eq 'Task' and QueueId eq '$($Queue.RowKey)'" | Where-Object { $_.Name } | Select-Object @{n = 'Timestamp'; exp = { $_.Timestamp.DateTime.ToUniversalTime() } }, Name, Status
$Tasks = Get-CIPPAzDataTableEntity @CippQueueTasks -Filter "PartitionKey eq 'Task' and QueueId eq '$($Queue.RowKey)'" | Where-Object { $_.Name } | Select-Object @{n = 'Timestamp'; exp = { $_.Timestamp } }, Name, Status
$TaskStatus = @{}
$Tasks | Group-Object -Property Status | ForEach-Object {
$TaskStatus.$($_.Name) = $_.Count
Expand Down Expand Up @@ -54,9 +66,9 @@ function Invoke-ListCippQueue {
PercentComplete = [math]::Round(((($TotalCompleted + $TotalFailed) / $Queue.TotalTasks) * 100), 1)
PercentFailed = [math]::Round((($TotalFailed / $Queue.TotalTasks) * 100), 1)
PercentRunning = [math]::Round((($TotalRunning / $Queue.TotalTasks) * 100), 1)
Tasks = @($Tasks)
Tasks = @($Tasks | Sort-Object -Descending Timestamp)
Status = $Queue.Status
Timestamp = $Queue.Timestamp.DateTime.ToUniversalTime()
Timestamp = $Queue.Timestamp
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function Push-BECRun {
$ExtractResult = 'Successfully extracted logs from auditlog'
}
Write-Information 'Getting last sign-in'
Try {
try {
$URI = "https://graph.microsoft.com/beta/auditLogs/signIns?`$filter=(userId eq '$SuspectUser')&`$top=1&`$orderby=createdDateTime desc"
$LastSignIn = New-GraphGetRequest -uri $URI -tenantid $TenantFilter -noPagination $true -verbose | Select-Object @{ Name = 'CreatedDateTime'; Expression = { $(($_.createdDateTime | Out-String) -replace '\r\n') } },
id,
Expand All @@ -69,7 +69,7 @@ function Push-BECRun {
#List all users devices
$Bytes = [System.Text.Encoding]::UTF8.GetBytes($SuspectUser)
$base64IdentityParam = [Convert]::ToBase64String($Bytes)
Try {
try {
$Devices = New-GraphGetRequest -uri "https://outlook.office365.com:443/adminapi/beta/$($TenantFilter)/mailbox('$($base64IdentityParam)')/MobileDevice/Exchange.GetMobileDeviceStatistics()/?IsEncoded=True" -Tenantid $TenantFilter -scope ExchangeOnline
} catch {
$Devices = $null
Expand Down Expand Up @@ -143,10 +143,10 @@ function Push-BECRun {
Write-Information 'Getting bulk requests'
$GraphResults = New-GraphBulkRequest -Requests $Requests -tenantid $TenantFilter -asapp $true

$PasswordChanges = ($GraphResults | Where-Object { $_.id -eq 'Users' }).body.value | Where-Object { $_.lastPasswordChangeDateTime -ge $startDate }
$NewUsers = ($GraphResults | Where-Object { $_.id -eq 'Users' }).body.value | Where-Object { $_.createdDateTime -ge $startDate }
$MFADevices = ($GraphResults | Where-Object { $_.id -eq 'MFADevices' }).body.value
$NewSPs = ($GraphResults | Where-Object { $_.id -eq 'NewSPs' }).body.value
$PasswordChanges = ($GraphResults | Where-Object { $_.id -eq 'Users' }).body.value | Where-Object { $_.lastPasswordChangeDateTime -ge $startDate } ?? @()
$NewUsers = ($GraphResults | Where-Object { $_.id -eq 'Users' }).body.value | Where-Object { $_.createdDateTime -ge $startDate } ?? @()
$MFADevices = ($GraphResults | Where-Object { $_.id -eq 'MFADevices' }).body.value ?? @()
$NewSPs = ($GraphResults | Where-Object { $_.id -eq 'NewSPs' }).body.value ?? @()


$Results = [PSCustomObject]@{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function Push-ListGraphRequestQueue {
ReverseTenantLookupProperty = $Item.ReverseTenantLookupProperty
ReverseTenantLookup = $Item.ReverseTenantLookup
AsApp = $Item.AsApp ?? $false
Caller = 'Push-ListGraphRequestQueue'
SkipCache = $true
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
function Push-ExecMdoAlertsListAllTenants {
<#
.FUNCTIONALITY
Entrypoint
#>
param($Item)

$Tenant = Get-Tenants -TenantFilter $Item.customerId
$domainName = $Tenant.defaultDomainName
$Table = Get-CIPPTable -TableName 'cachealertsandincidents'

try {
# Get MDO alerts using the specific endpoint and filter
$Alerts = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/security/alerts_v2?`$filter=serviceSource eq 'microsoftDefenderForOffice365'" -tenantid $domainName

foreach ($Alert in $Alerts) {
$GUID = (New-Guid).Guid
$GraphRequest = @{
MdoAlert = [string]($Alert | ConvertTo-Json -Depth 10)
RowKey = [string]$GUID
PartitionKey = 'MdoAlert'
Tenant = [string]$domainName
}
Add-CIPPAzDataTableEntity @Table -Entity $GraphRequest -Force | Out-Null
}

} catch {
$GUID = (New-Guid).Guid
$AlertText = ConvertTo-Json -InputObject @{
Tenant = $domainName
displayName = "Could not connect to Tenant: $($_.Exception.Message)"
id = ''
severity = 'CIPP'
status = 'Failed'
createdDateTime = (Get-Date).ToString('s')
category = 'Unknown'
description = 'Could not connect'
serviceSource = 'microsoftDefenderForOffice365'
}
$GraphRequest = @{
MdoAlert = [string]$AlertText
RowKey = [string]$GUID
PartitionKey = 'MdoAlert'
Tenant = [string]$domainName
}
Add-CIPPAzDataTableEntity @Table -Entity $GraphRequest -Force | Out-Null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ function Push-ListMailboxRulesQueue {

$Table = Get-CIPPTable -TableName cachembxrules
try {
$Rules = New-ExoRequest -tenantid $domainName -cmdlet 'Get-Mailbox' -Select 'userPrincipalName,GUID' | ForEach-Object -Parallel {
Import-Module CIPPCore
$MbxRules = New-ExoRequest -Anchor $_.UserPrincipalName -tenantid $using:domainName -cmdlet 'Get-InboxRule' -cmdParams @{Mailbox = $_.GUID; IncludeHidden = $true } | Where-Object { $_.Name -ne 'Junk E-Mail Rule' -and $_.Name -notlike 'Microsoft.Exchange.OOF.*' }
foreach ($Rule in $MbxRules) {
$Rule | Add-Member -NotePropertyName 'UserPrincipalName' -NotePropertyValue $_.userPrincipalName
$Rule
$Mailboxes = New-ExoRequest -tenantid $domainName -cmdlet 'Get-Mailbox' -Select 'userPrincipalName,GUID'
$Request = $Mailboxes | ForEach-Object {
@{
OperationGuid = $_.UserPrincipalName
CmdletInput = @{
CmdletName = 'Get-InboxRule'
Parameters = @{
Mailbox = $_.UserPrincipalName
}
}
}
}

$Rules = New-ExoBulkRequest -tenantid $domainName -cmdletArray @($Request) | Where-Object { $_.Identity }
if (($Rules | Measure-Object).Count -gt 0) {
$GraphRequest = foreach ($Rule in $Rules) {
[PSCustomObject]@{
Expand Down
Loading