Skip to content

Commit

Permalink
print all extended properties as test
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Aug 10, 2023
1 parent e5126cf commit 78253fb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Modules/CIPPCore/Public/Invoke-CIPPWebhookProcessing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ function Invoke-CippWebhookProcessing {
$LocationTable = Get-CIPPTable -TableName 'knownlocationdb'

Write-Host "Result status $($data.ResultStatus)"
Write-Host "Result status detail $($data.ExtendedProperties.ResultStatusDetail)"
Write-Host "Result status detail $($data.ExtendedProperties['ResultStatusDetail'])"
Write-Host "Extended properties as json: $($data.ExtendedProperties | ConvertTo-Json -Depth 10)"
Write-Host "country: $Country"

switch ($data.operation) {
{ "UserLoggedIn" -eq $data.operation -and $Country -notin $AllowedLocations -and $data.ResultStatus -eq "Success" -and $data.ExtendedProperties.ResultStatusDetail -eq "Success" } { $data.operation = "UserLoggedInFromUnknownLocation"; break }
{ "UserloggedIn" -eq $data.operation -and $data.UserType -eq 2 -and $data.ResultStatus -eq "Success" -and $data.ExtendedProperties.ResultStatusDetail -eq "Success" } { $data.operation = "AdminLoggedIn"; break }
Expand All @@ -36,8 +38,7 @@ function Invoke-CippWebhookProcessing {
Write-Host "No need to process this operation."
return ""
}
#Make URL frontend URL:
$CIPPPURL = $CIPPURL -split '/API' | Select-Object -First 1

switch ($data.Operation) {
"New-InboxRule" {
$Title = "$($TenantFilter) - New Rule Detected for $($data.UserId)"
Expand Down

0 comments on commit 78253fb

Please sign in to comment.