File tree Expand file tree Collapse file tree 4 files changed +7
-8
lines changed
Entrypoints/HTTP Functions/Identity/Administration/Users Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 11using namespace System.Net
22
3- Function Invoke-ExecJITAdmin {
3+ function Invoke-ExecJITAdmin {
44 <#
55 . FUNCTIONALITY
66 Entrypoint
@@ -16,8 +16,7 @@ Function Invoke-ExecJITAdmin {
1616 Write-LogMessage - Headers $User - API $APINAME - message ' Accessed this API' - Sev ' Debug'
1717
1818 if ($Request.Query.Action -eq ' List' ) {
19- $Schema = Get-CIPPSchemaExtensions | Where-Object { $_.id -match ' _cippUser' }
20- # Write-Information "Schema: $($Schema)"
19+ $Schema = Get-CIPPSchemaExtensions | Where-Object { $_.id -match ' _cippUser' } | Select-Object - First 1
2120 $Query = @ {
2221 TenantFilter = $Request.Query.TenantFilter
2322 Endpoint = ' users'
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ function Set-CIPPUserJITAdmin {
2626
2727 #>
2828 [CmdletBinding (SupportsShouldProcess = $true )]
29- Param (
29+ param (
3030 [Parameter (Mandatory = $true )]
3131 [string ]$TenantFilter ,
3232
@@ -50,7 +50,7 @@ function Set-CIPPUserJITAdmin {
5050 switch ($Action ) {
5151 ' Create' {
5252 $Password = New-passwordString
53- $Schema = Get-CIPPSchemaExtensions | Where-Object { $_.id -match ' _cippUser' }
53+ $Schema = Get-CIPPSchemaExtensions | Where-Object { $_.id -match ' _cippUser' } | Select-Object - First 1
5454
5555 $Body = @ {
5656 givenName = $User.FirstName
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ function Set-CIPPUserJITAdminProperties {
88 [switch ]$Clear
99 )
1010 try {
11- $Schema = Get-CIPPSchemaExtensions | Where-Object { $_.id -match ' _cippUser' }
11+ $Schema = Get-CIPPSchemaExtensions | Where-Object { $_.id -match ' _cippUser' } | Select-Object - First 1
1212 if ($Clear.IsPresent ) {
1313 $Body = [PSCustomObject ]@ {
1414 " $ ( $Schema.id ) " = @ {
@@ -24,7 +24,7 @@ function Set-CIPPUserJITAdminProperties {
2424 }
2525 }
2626 }
27-
27+
2828 $Json = ConvertTo-Json - Depth 5 - InputObject $Body
2929 Write-Information $Json
3030 New-GraphPOSTRequest - type PATCH - Uri " https://graph.microsoft.com/beta/users/$UserId " - Body $Json - tenantid $TenantFilter | Out-Null
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function Set-CIPPUserSchemaProperties {
2424 [object ]$Users
2525 )
2626
27- $Schema = Get-CIPPSchemaExtensions | Where-Object { $_.id -match ' _cippUser' }
27+ $Schema = Get-CIPPSchemaExtensions | Where-Object { $_.id -match ' _cippUser' } | Select-Object - First 1
2828 $int = 0
2929 $Requests = foreach ($User in $Users ) {
3030 @ {
You can’t perform that action at this time.
0 commit comments