File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed
Entrypoints/HTTP Functions/Tenant/GDAP Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,8 @@ Function Invoke-ExecAutoExtendGDAP {
1010 [CmdletBinding ()]
1111 param ($Request , $TriggerMetadata )
1212
13- $APIName = $TriggerMetadata.FunctionName
14- Write-LogMessage - user $request.headers .' x-ms-client-principal' - API $APINAME - message ' Accessed this API' - Sev ' Debug'
15-
16- # Interact with query parameters or the body of the request.
17- $Results = Set-CIPPGDAPAutoExtend - RelationShipid $Request.query.ID
13+ $Id = $Request.query.ID ?? $Request.Body.ID
14+ $Results = Set-CIPPGDAPAutoExtend - RelationShipid $Id
1815
1916 # Associate values to output bindings by calling 'Push-OutputBinding'.
2017 Push-OutputBinding - Name Response - Value ([HttpResponseContext ]@ {
Original file line number Diff line number Diff line change @@ -9,10 +9,7 @@ Function Invoke-ExecGDAPRemoveGArole {
99 [CmdletBinding ()]
1010 param ($Request , $TriggerMetadata )
1111
12- $APIName = $TriggerMetadata.FunctionName
13- Write-LogMessage - user $request.headers .' x-ms-client-principal' - API $APINAME - message ' Accessed this API' - Sev ' Debug'
14-
15- $GDAPID = $request.query.GDAPId
12+ $GDAPID = $request.query.GDAPId ?? $request.Body.GDAPId
1613
1714 try {
1815 $CheckActive = New-GraphGetRequest - NoAuthCheck $True - uri " https://graph.microsoft.com/beta/tenantRelationships/delegatedAdminRelationships/$ ( $GDAPID ) " - tenantid $env: TenantID
@@ -36,7 +33,7 @@ Function Invoke-ExecGDAPRemoveGArole {
3633 $Message = " Relationship status is currently $ ( $CheckActive.status ) , it is not possible to remove the Global Administrator role in this state."
3734 }
3835 if (' 62e90394-69f5-4237-9190-012177145e10' -notin $CheckActive.accessDetails.unifiedRoles.roleDefinitionId ) {
39- $Message = " This relationship does not contain the Global Administrator role."
36+ $Message = ' This relationship does not contain the Global Administrator role.'
4037 }
4138 }
4239 } catch {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function New-GraphGetRequest {
1010 [string ]$scope ,
1111 [bool ]$AsApp ,
1212 [bool ]$noPagination ,
13- [ bool ] $NoAuthCheck ,
13+ $NoAuthCheck = $false ,
1414 [bool ]$skipTokenCache ,
1515 $Caller ,
1616 [switch ]$ComplexFilter ,
You can’t perform that action at this time.
0 commit comments