Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
082b8da
API for Managing Exchange Retention Tags & Policies
Zacgoose Aug 9, 2025
86501a1
update open api spec
Zacgoose Aug 11, 2025
d539326
remove user condition fallback
JohnDuprey Aug 19, 2025
2e79bd7
fix typo
JohnDuprey Aug 19, 2025
622ba18
Add SendNotificationToUser parameter to calendar permission functions
kris6673 Aug 19, 2025
2107904
Fix: Fix deleting app config and protection policies
kris6673 Aug 19, 2025
573e14b
add skiplog parameter to test capabilities
JohnDuprey Aug 19, 2025
640131a
Merge pull request #1592 from kris6673/issue4498
KelvinTegelaar Aug 19, 2025
2a97681
hudu improvements
JohnDuprey Aug 19, 2025
8128c2c
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
JohnDuprey Aug 19, 2025
298a0d0
Merge pull request #1584 from Zacgoose/exchange-retention
KelvinTegelaar Aug 19, 2025
c7d837c
Merge pull request #1591 from kris6673/issue4538
KelvinTegelaar Aug 19, 2025
eb5975e
clone to drift
KelvinTegelaar Aug 20, 2025
cdd9bbc
drift email fix
KelvinTegelaar Aug 20, 2025
9d6d6be
Create Get-CIPPAlertSmtpAuthSuccess.ps1
DirkHaex Aug 20, 2025
d4c2eb0
Merge pull request #1594 from DirkHaex/patch-11
KelvinTegelaar Aug 20, 2025
b4c7fb3
add logging
JohnDuprey Aug 20, 2025
799e1d1
fix for splitting on 7.5.
KelvinTegelaar Aug 20, 2025
531ef18
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Aug 20, 2025
5b3ed69
Add functionality for user to select HaloPSA ticket outcome and add h…
jspern Aug 20, 2025
4ec8ed9
Merge pull request #1596 from N2M-Technology/feat-halopsa-outcomes
JohnDuprey Aug 20, 2025
350678e
filter out blacklisted domain response
JohnDuprey Aug 20, 2025
16be2df
add partitionkey
JohnDuprey Aug 20, 2025
aea48b9
Update Invoke-ExecOffboardUser.ps1
JohnDuprey Aug 20, 2025
1043788
Update version_latest.txt
JohnDuprey Aug 20, 2025
d8d9df3
Merge pull request #1597 from KelvinTegelaar/dev
JohnDuprey Aug 20, 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
1 change: 1 addition & 0 deletions Modules/CIPPCore/Public/Add-CIPPAzDataTableEntity.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function Add-CIPPAzDataTableEntity {

$propertiesToRemove = [System.Collections.Generic.List[object]]::new()
foreach ($key in $SingleEnt.Keys) {
if ($key -in @('RowKey', 'PartitionKey')) { continue }
$newEntitySize = [System.Text.Encoding]::UTF8.GetByteCount($($newEntity | ConvertTo-Json -Compress))
if ($newEntitySize -lt $MaxRowSize) {
$propertySize = [System.Text.Encoding]::UTF8.GetByteCount($SingleEnt[$key].ToString())
Expand Down
32 changes: 32 additions & 0 deletions Modules/CIPPCore/Public/Alerts/Get-CIPPAlertSmtpAuthSuccess.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
function Get-CIPPAlertSmtpAuthSuccess {
<#
.FUNCTIONALITY
Entrypoint – Check sign-in logs for SMTP AUTH with success status
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory = $false)]
[Alias('input')]
$InputValue,
$TenantFilter
)

try {
# Graph API endpoint for sign-ins
$uri = "https://graph.microsoft.com/v1.0/auditLogs/signIns?`$filter=clientAppUsed eq 'SMTP' and status/errorCode eq 0"

# Call Graph API for the given tenant
$SignIns = New-GraphGetRequest -uri $uri -tenantid $TenantFilter

# Select only the properties you care about
$AlertData = $SignIns.value | Select-Object userPrincipalName, createdDateTime, clientAppUsed, ipAddress, status

# Write results into the alert pipeline
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData

} catch {
# Suppress errors if no data returned
# Uncomment if you want explicit error logging
# Write-AlertMessage -tenant $($TenantFilter) -message "Failed to query SMTP AUTH sign-ins for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ function Push-ExecOnboardTenantQueue {
$Table = Get-CippTable -tablename 'templates'
$ExistingTemplates = Get-CippazDataTableEntity @Table -Filter "PartitionKey eq 'StandardsTemplateV2'" | Where-Object { $_.JSON -match 'AllTenants' }
foreach ($AllTenantsTemplate in $ExistingTemplates) {
$object = $AllTenantesTemplate.JSON | ConvertFrom-Json
$object = $AllTenantsTemplate.JSON | ConvertFrom-Json
$NewExcludedTenants = [system.collections.generic.list[object]]::new()
if (!$object.excludedTenants) {
$object | Add-Member -MemberType NoteProperty -Name 'excludedTenants' -Value @() -Force
Expand Down
Original file line number Diff line number Diff line change
@@ -1,121 +1,127 @@
using namespace System.Net

Function Invoke-ExecExtensionMapping {
<#
<#
.FUNCTIONALITY
Entrypoint
.ROLE
CIPP.Extension.ReadWrite
#>
[CmdletBinding()]
param($Request, $TriggerMetadata)
[CmdletBinding()]
param($Request, $TriggerMetadata)

$APIName = $Request.Params.CIPPEndpoint
$Headers = $Request.Headers
Write-LogMessage -headers $Headers -API $APIName -message 'Accessed this API' -Sev 'Debug'
$APIName = $Request.Params.CIPPEndpoint
$Headers = $Request.Headers
Write-LogMessage -headers $Headers -API $APIName -message 'Accessed this API' -Sev 'Debug'

$Table = Get-CIPPTable -TableName CippMapping
$Table = Get-CIPPTable -TableName CippMapping

if ($Request.Query.List) {
switch ($Request.Query.List) {
'HaloPSA' {
$Result = Get-HaloMapping -CIPPMapping $Table
}
'NinjaOne' {
$Result = Get-NinjaOneOrgMapping -CIPPMapping $Table
}
'NinjaOneFields' {
$Result = Get-NinjaOneFieldMapping -CIPPMapping $Table
}
'Hudu' {
$Result = Get-HuduMapping -CIPPMapping $Table
}
'HuduFields' {
$Result = Get-HuduFieldMapping -CIPPMapping $Table
}
'Sherweb' {
$Result = Get-SherwebMapping -CIPPMapping $Table
}
'HaloPSAFields' {
$TicketTypes = Get-HaloTicketType
$Result = @{'TicketTypes' = $TicketTypes }
}
'PWPushFields' {
$Accounts = Get-PwPushAccount
$Result = @{
'Accounts' = $Accounts
}
}
if ($Request.Query.List) {
switch ($Request.Query.List) {
'HaloPSA' {
$Result = Get-HaloMapping -CIPPMapping $Table
}
'NinjaOne' {
$Result = Get-NinjaOneOrgMapping -CIPPMapping $Table
}
'NinjaOneFields' {
$Result = Get-NinjaOneFieldMapping -CIPPMapping $Table
}
'Hudu' {
$Result = Get-HuduMapping -CIPPMapping $Table
}
'HuduFields' {
$Result = Get-HuduFieldMapping -CIPPMapping $Table
}
'Sherweb' {
$Result = Get-SherwebMapping -CIPPMapping $Table
}
'HaloPSAFields' {
$TicketTypes = Get-HaloTicketType
$Outcomes = Get-HaloTicketOutcome
$Result = @{
'TicketTypes' = $TicketTypes
'Outcomes' = $Outcomes
}
}
'PWPushFields' {
$Accounts = Get-PwPushAccount
$Result = @{
'Accounts' = $Accounts
}
}
}
}

try {
if ($Request.Query.AddMapping) {
switch ($Request.Query.AddMapping) {
'Sherweb' {
$Result = Set-SherwebMapping -CIPPMapping $Table -APIName $APIName -Request $Request
}
'HaloPSA' {
$Result = Set-HaloMapping -CIPPMapping $Table -APIName $APIName -Request $Request
}
'NinjaOne' {
$Result = Set-NinjaOneOrgMapping -CIPPMapping $Table -APIName $APIName -Request $Request
Register-CIPPExtensionScheduledTasks
}
'NinjaOneFields' {
$Result = Set-NinjaOneFieldMapping -CIPPMapping $Table -APIName $APIName -Request $Request -TriggerMetadata $TriggerMetadata
Register-CIPPExtensionScheduledTasks
}
'Hudu' {
$Result = Set-HuduMapping -CIPPMapping $Table -APIName $APIName -Request $Request
Register-CIPPExtensionScheduledTasks
}
'HuduFields' {
$Result = Set-ExtensionFieldMapping -CIPPMapping $Table -APIName $APIName -Request $Request -Extension 'Hudu'
Register-CIPPExtensionScheduledTasks
}
}
try {
if ($Request.Query.AddMapping) {
switch ($Request.Query.AddMapping) {
'Sherweb' {
$Result = Set-SherwebMapping -CIPPMapping $Table -APIName $APIName -Request $Request
}
'HaloPSA' {
$Result = Set-HaloMapping -CIPPMapping $Table -APIName $APIName -Request $Request
}
'NinjaOne' {
$Result = Set-NinjaOneOrgMapping -CIPPMapping $Table -APIName $APIName -Request $Request
Register-CIPPExtensionScheduledTasks
}
'NinjaOneFields' {
$Result = Set-NinjaOneFieldMapping -CIPPMapping $Table -APIName $APIName -Request $Request -TriggerMetadata $TriggerMetadata
Register-CIPPExtensionScheduledTasks
}
$StatusCode = [HttpStatusCode]::OK
} catch {
$ErrorMessage = Get-CippException -Exception $_
$Result = "Mapping API failed. $($ErrorMessage.NormalizedError)"
Write-LogMessage -API $APIName -headers $Headers -message $Result -Sev 'Error' -LogData $ErrorMessage
$StatusCode = [HttpStatusCode]::InternalServerError
'Hudu' {
$Result = Set-HuduMapping -CIPPMapping $Table -APIName $APIName -Request $Request
Register-CIPPExtensionScheduledTasks
}
'HuduFields' {
$Result = Set-ExtensionFieldMapping -CIPPMapping $Table -APIName $APIName -Request $Request -Extension 'Hudu'
Register-CIPPExtensionScheduledTasks
}
}
}
$StatusCode = [HttpStatusCode]::OK
}
catch {
$ErrorMessage = Get-CippException -Exception $_
$Result = "Mapping API failed. $($ErrorMessage.NormalizedError)"
Write-LogMessage -API $APIName -headers $Headers -message $Result -Sev 'Error' -LogData $ErrorMessage
$StatusCode = [HttpStatusCode]::InternalServerError
}

try {
if ($Request.Query.AutoMapping) {
switch ($Request.Query.AutoMapping) {
'NinjaOne' {
$Batch = [PSCustomObject]@{
'NinjaAction' = 'StartAutoMapping'
'FunctionName' = 'NinjaOneQueue'
}
$InputObject = [PSCustomObject]@{
OrchestratorName = 'NinjaOneOrchestrator'
Batch = @($Batch)
}
#Write-Host ($InputObject | ConvertTo-Json)
$InstanceId = Start-NewOrchestration -FunctionName 'CIPPOrchestrator' -InputObject ($InputObject | ConvertTo-Json -Depth 5 -Compress)
Write-Host "Started permissions orchestration with ID = '$InstanceId'"
$Result = 'AutoMapping Request has been queued. Exact name matches will appear first and matches on device names and serials will take longer. Please check the CIPP Logbook and refresh the page once complete.'
}

}
try {
if ($Request.Query.AutoMapping) {
switch ($Request.Query.AutoMapping) {
'NinjaOne' {
$Batch = [PSCustomObject]@{
'NinjaAction' = 'StartAutoMapping'
'FunctionName' = 'NinjaOneQueue'
}
$InputObject = [PSCustomObject]@{
OrchestratorName = 'NinjaOneOrchestrator'
Batch = @($Batch)
}
#Write-Host ($InputObject | ConvertTo-Json)
$InstanceId = Start-NewOrchestration -FunctionName 'CIPPOrchestrator' -InputObject ($InputObject | ConvertTo-Json -Depth 5 -Compress)
Write-Host "Started permissions orchestration with ID = '$InstanceId'"
$Result = 'AutoMapping Request has been queued. Exact name matches will appear first and matches on device names and serials will take longer. Please check the CIPP Logbook and refresh the page once complete.'
}
$StatusCode = [HttpStatusCode]::OK
} catch {
$ErrorMessage = Get-CippException -Exception $_
$Result = "Mapping API failed. $($ErrorMessage.NormalizedError)"
Write-LogMessage -API $APIName -headers $Headers -message $Result -Sev 'Error' -LogData $ErrorMessage
$StatusCode = [HttpStatusCode]::InternalServerError

}
}
$StatusCode = [HttpStatusCode]::OK
}
catch {
$ErrorMessage = Get-CippException -Exception $_
$Result = "Mapping API failed. $($ErrorMessage.NormalizedError)"
Write-LogMessage -API $APIName -headers $Headers -message $Result -Sev 'Error' -LogData $ErrorMessage
$StatusCode = [HttpStatusCode]::InternalServerError
}

# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = $StatusCode
Body = $Result
})
# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = $StatusCode
Body = $Result
})

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using namespace System.Net

Function Invoke-ExecModifyCalPerms {
function Invoke-ExecModifyCalPerms {
<#
.FUNCTIONALITY
Entrypoint
Expand Down Expand Up @@ -64,6 +64,7 @@ Function Invoke-ExecModifyCalPerms {
$Modification = $Permission.Modification
$CanViewPrivateItems = $Permission.CanViewPrivateItems ?? $false
$FolderName = $Permission.FolderName ?? 'Calendar'
$SendNotificationToUser = $Permission.SendNotificationToUser ?? $false

Write-LogMessage -headers $Headers -API $APIName -message "Permission Level: $PermissionLevel, Modification: $Modification, CanViewPrivateItems: $CanViewPrivateItems, FolderName: $FolderName" -Sev 'Debug'

Expand All @@ -76,16 +77,17 @@ Function Invoke-ExecModifyCalPerms {
try {
Write-LogMessage -headers $Headers -API $APIName -message "Processing target user: $TargetUser" -Sev 'Debug'
$Params = @{
APIName = $APIName
Headers = $Headers
RemoveAccess = if ($Modification -eq 'Remove') { $TargetUser } else { $null }
TenantFilter = $TenantFilter
UserID = $UserId
folderName = $FolderName
UserToGetPermissions = $TargetUser
LoggingName = $TargetUser
Permissions = $PermissionLevel
CanViewPrivateItems = $CanViewPrivateItems
APIName = $APIName
Headers = $Headers
RemoveAccess = if ($Modification -eq 'Remove') { $TargetUser } else { $null }
TenantFilter = $TenantFilter
UserID = $UserId
folderName = $FolderName
UserToGetPermissions = $TargetUser
LoggingName = $TargetUser
Permissions = $PermissionLevel
CanViewPrivateItems = $CanViewPrivateItems
SendNotificationToUser = $SendNotificationToUser
}

# Write-Host "Request params: $($Params | ConvertTo-Json)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Function Invoke-ListMailboxes {
# Interact with query parameters or the body of the request.
$TenantFilter = $Request.Query.tenantFilter
try {
$Select = 'id,ExchangeGuid,ArchiveGuid,UserPrincipalName,DisplayName,PrimarySMTPAddress,RecipientType,RecipientTypeDetails,EmailAddresses,WhenSoftDeleted,IsInactiveMailbox,ForwardingSmtpAddress,DeliverToMailboxAndForward,ForwardingAddress,HiddenFromAddressListsEnabled,ExternalDirectoryObjectId,MessageCopyForSendOnBehalfEnabled,MessageCopyForSentAsEnabled,PersistedCapabilities,LitigationHoldEnabled,LitigationHoldDate,LitigationHoldDuration,ComplianceTagHoldApplied,RetentionHoldEnabled,InPlaceHolds'
$Select = 'id,ExchangeGuid,ArchiveGuid,UserPrincipalName,DisplayName,PrimarySMTPAddress,RecipientType,RecipientTypeDetails,EmailAddresses,WhenSoftDeleted,IsInactiveMailbox,ForwardingSmtpAddress,DeliverToMailboxAndForward,ForwardingAddress,HiddenFromAddressListsEnabled,ExternalDirectoryObjectId,MessageCopyForSendOnBehalfEnabled,MessageCopyForSentAsEnabled,PersistedCapabilities,LitigationHoldEnabled,LitigationHoldDate,LitigationHoldDuration,ComplianceTagHoldApplied,RetentionHoldEnabled,InPlaceHolds,RetentionPolicy'
$ExoRequest = @{
tenantid = $TenantFilter
cmdlet = 'Get-Mailbox'
Expand Down Expand Up @@ -76,7 +76,8 @@ Function Invoke-ListMailboxes {
@{ Name = 'LicensedForLitigationHold'; Expression = { ($_.PersistedCapabilities -contains 'BPOS_S_DlpAddOn' -or $_.PersistedCapabilities -contains 'BPOS_S_Enterprise') } },
ComplianceTagHoldApplied,
RetentionHoldEnabled,
InPlaceHolds
InPlaceHolds,
RetentionPolicy
# This select also exists in ListUserMailboxDetails and should be updated if this is changed here


Expand Down
Loading