From 7997ee59d23721d4c9273a06981b59b97423c2ca Mon Sep 17 00:00:00 2001 From: John Duprey Date: Sun, 12 Jan 2025 14:39:41 -0500 Subject: [PATCH 1/5] add body support --- .../Tenant/GDAP/Invoke-ExecAutoExtendGDAP.ps1 | 7 ++----- .../Tenant/GDAP/Invoke-ExecGDAPRemoveGArole.ps1 | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/GDAP/Invoke-ExecAutoExtendGDAP.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/GDAP/Invoke-ExecAutoExtendGDAP.ps1 index f57c65330f6f..6ef66517cef1 100644 --- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/GDAP/Invoke-ExecAutoExtendGDAP.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/GDAP/Invoke-ExecAutoExtendGDAP.ps1 @@ -10,11 +10,8 @@ Function Invoke-ExecAutoExtendGDAP { [CmdletBinding()] param($Request, $TriggerMetadata) - $APIName = $TriggerMetadata.FunctionName - Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug' - - # Interact with query parameters or the body of the request. - $Results = Set-CIPPGDAPAutoExtend -RelationShipid $Request.query.ID + $Id = $Request.query.ID ?? $Request.Body.ID + $Results = Set-CIPPGDAPAutoExtend -RelationShipid $Id # Associate values to output bindings by calling 'Push-OutputBinding'. Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{ diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/GDAP/Invoke-ExecGDAPRemoveGArole.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/GDAP/Invoke-ExecGDAPRemoveGArole.ps1 index c6a60971f1c6..6a41ac39fb5f 100644 --- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/GDAP/Invoke-ExecGDAPRemoveGArole.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/GDAP/Invoke-ExecGDAPRemoveGArole.ps1 @@ -9,10 +9,7 @@ Function Invoke-ExecGDAPRemoveGArole { [CmdletBinding()] param($Request, $TriggerMetadata) - $APIName = $TriggerMetadata.FunctionName - Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug' - - $GDAPID = $request.query.GDAPId + $GDAPID = $request.query.GDAPId ?? $request.Body.GDAPId try { $CheckActive = New-GraphGetRequest -NoAuthCheck $True -uri "https://graph.microsoft.com/beta/tenantRelationships/delegatedAdminRelationships/$($GDAPID)" -tenantid $env:TenantID @@ -36,7 +33,7 @@ Function Invoke-ExecGDAPRemoveGArole { $Message = "Relationship status is currently $($CheckActive.status), it is not possible to remove the Global Administrator role in this state." } if ('62e90394-69f5-4237-9190-012177145e10' -notin $CheckActive.accessDetails.unifiedRoles.roleDefinitionId) { - $Message = "This relationship does not contain the Global Administrator role." + $Message = 'This relationship does not contain the Global Administrator role.' } } } catch { From 69681b84df4975d8e988e74f899890fd47eb72b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Tue, 14 Jan 2025 14:31:13 +0100 Subject: [PATCH 2/5] Update Compliance Portal link to Purview in Invoke-NinjaOneTenantSync function --- .../Public/NinjaOne/Invoke-NinjaOneTenantSync.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/CippExtensions/Public/NinjaOne/Invoke-NinjaOneTenantSync.ps1 b/Modules/CippExtensions/Public/NinjaOne/Invoke-NinjaOneTenantSync.ps1 index 194ef0317290..696190855327 100644 --- a/Modules/CippExtensions/Public/NinjaOne/Invoke-NinjaOneTenantSync.ps1 +++ b/Modules/CippExtensions/Public/NinjaOne/Invoke-NinjaOneTenantSync.ps1 @@ -1748,7 +1748,7 @@ function Invoke-NinjaOneTenantSync { }, @{ Name = 'Compliance Portal' - Link = "https://compliance.microsoft.com/?tid=$($Customer.CustomerId)" + Link = "https://purview.microsoft.com/?tid=$($Customer.CustomerId)" Icon = 'fas fa-user-shield' }, @{ From 8c50115bd60325471c72184deb64d4d4ebc52cf6 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Tue, 14 Jan 2025 12:54:36 -0500 Subject: [PATCH 3/5] Change NoAuthCheck to default $false --- Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1 b/Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1 index b399d43038ca..7d8d3ff3ad99 100644 --- a/Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1 +++ b/Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1 @@ -10,7 +10,7 @@ function New-GraphGetRequest { [string]$scope, [bool]$AsApp, [bool]$noPagination, - [bool]$NoAuthCheck, + $NoAuthCheck = $false, [bool]$skipTokenCache, $Caller, [switch]$ComplexFilter, From a75a37a6c1cc521172e0b2f02e48f906570a41e6 Mon Sep 17 00:00:00 2001 From: Esco Date: Tue, 14 Jan 2025 15:05:14 +0100 Subject: [PATCH 4/5] fix: repair Quarantine Management --- .../Invoke-ExecQuarantineManagement.ps1 | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Email-Exchange/Invoke-ExecQuarantineManagement.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Email-Exchange/Invoke-ExecQuarantineManagement.ps1 index e22301a7629c..893302ffb327 100644 --- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Email-Exchange/Invoke-ExecQuarantineManagement.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Email-Exchange/Invoke-ExecQuarantineManagement.ps1 @@ -11,7 +11,7 @@ Function Invoke-ExecQuarantineManagement { param($Request, $TriggerMetadata) $APIName = $TriggerMetadata.FunctionName - Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug' + Write-LogMessage -user $Request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug' # Write to the Azure Functions log stream. @@ -20,19 +20,19 @@ Function Invoke-ExecQuarantineManagement { # Interact with query parameters or the body of the request. Try { - $tenantfilter = $Request.Query.TenantFilter + $TenantFilter = $Request.Body.tenantFilter $params = @{ - Identity = $request.query.ID - AllowSender = [boolean]$Request.query.AllowSender - ReleasetoAll = [boolean]$Request.query.type - ActionType = $Request.query.type + Identity = $Request.Body.Identity + AllowSender = [boolean]$Request.Body.AllowSender + ReleaseToAll = [boolean]$Request.Body.Type + ActionType = $Request.Body.Type } - Write-Host $params + New-ExoRequest -tenantid $TenantFilter -cmdlet 'Release-QuarantineMessage' -cmdParams $Params - $Results = [pscustomobject]@{'Results' = "Successfully processed $($request.query.ID)" } - Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -tenant $($tenantfilter) -message "$($request.query.id)" -Sev 'Info' + $Results = [pscustomobject]@{'Results' = "Successfully processed $($Request.Body.Identity)" } + Write-LogMessage -user $Request.headers.'x-ms-client-principal' -API $APINAME -tenant $TenantFilter -message "Successfully processed Quarantine ID $($Request.Body.Identity)" -Sev 'Info' } catch { - Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -tenant $($tenantfilter) -message "Quarantine Management failed: $($_.Exception.Message)" -Sev 'Error' + Write-LogMessage -user $Request.headers.'x-ms-client-principal' -API $APINAME -tenant $TenantFilter -message "Quarantine Management failed: $($_.Exception.Message)" -Sev 'Error' -LogData $_ $Results = [pscustomobject]@{'Results' = "Failed. $($_.Exception.Message)" } } # Associate values to output bindings by calling 'Push-OutputBinding'. From 1d09cd465ed23ca5fe7e999745a131a0efec78ae Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:15:54 +0100 Subject: [PATCH 5/5] upped versions --- version_latest.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_latest.txt b/version_latest.txt index a8907c025d5f..a50da181e9bd 100644 --- a/version_latest.txt +++ b/version_latest.txt @@ -1 +1 @@ -7.0.2 +7.0.3