V2.9.4#214
Conversation
* invoke changes for duplicate SIDs * invoke script cleanup * validate changes for local device * invoke migration CSV validation tests * pwsh 5.1 returning non list
* invoke changes for duplicate SIDs * invoke script cleanup * validate changes for local device * invoke migration CSV validation tests * removeMDM * RemoveMDM * generate docs from windows & update tests for 5.1 * uncheck removeMDM if leave domain in de-selected
* init test EU * run number * systemContext * ci * test * ci env * test EU * api test * test * api test * pester vars * invoke systemcontext url * revert ci * URL * Update Deploy/Functions/New-ADMUTemplate.ps1 [skip ci] Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update jumpcloud-ADMU/Powershell/Private/DisplayForms/Form.ps1 [skip ci] Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update jumpcloud-ADMU/Powershell/Private/SystemContext/Invoke-SystemContextAPI.ps1 [skip ci] Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * dates * Update .github/workflows/admu-ci.yml [skip ci] Co-authored-by: Joe Workman <54448601+jworkmanjc@users.noreply.github.com> * invoke system context + move set-jcurl test --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Joe Workman <54448601+jworkmanjc@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR updates the ADMU (Active Directory Migration Utility) to version 2.9.4, introducing support for JumpCloud EU organizations and adding MDM removal capabilities during device migration.
Key Changes:
- Added EU region support for JumpCloud API authentication
- Implemented MDM enrollment removal feature with the
removeMDMparameter - Refined CSV validation logic to check for duplicate SIDs only on the local device
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| JumpCloud.ADMU.psd1 | Updated module version from 2.9.3 to 2.9.4 |
| Start-Migration.ps1 | Added removeMDM parameter and MDM removal logic |
| Get-WindowsMDMProvider.ps1 | New function to retrieve Windows MDM enrollment information |
| Remove-WindowsMDMProvider.ps1 | New function to remove Windows MDM enrollments |
| Invoke-SystemContextAPI.ps1 | Added region detection from agent config and dynamic URL construction |
| Set-JCUrl.ps1 | New function to set JumpCloud URL based on region (US/EU) |
| Test-JumpCloudUsername.ps1 | Updated to support US/EU region fallback logic |
| Get-MtpOrganization.ps1 | Added try/catch blocks for US/EU region failover |
| Form.ps1 | Added RemoveMDM checkbox to GUI and version update |
| invokeMigration.Tests.ps1 | Refined duplicate SID validation to only check local device |
| 3_ADMU_Invoke.ps1 | Updated CSV validation and integrated MDM removal into batch migration |
Comments suppressed due to low confidence (1)
jumpcloud-ADMU/Powershell/Tests/Public/invokeMigration.Tests.ps1:1
- The code structure has mismatched or extra closing braces. Line 188 closes the PSCustomObject Add, line 189 closes the if statement checking LocalComputerName/SerialNumber, but line 190 appears to be an extra closing brace that doesn't match the opening structure shown in the diff.
Describe "ADMU Bulk Migration Script CI Tests" -Tag "Migration Parameters" {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Call EU endpoint if US fails | ||
| Set-JcUrl -Region "EU" | ||
| $baseUrl = "$($global:JCUrl)/api/search/systemusers" | ||
| $Response = Invoke-WebRequest -Method 'Post' -Uri $baseUrl -Headers $Headers -Body $Body -UseBasicParsing | ||
| $Results = $Response.Content | ConvertFrom-Json | ||
| $StatusCode = $Response.StatusCode |
There was a problem hiding this comment.
The catch block silently retries with the EU endpoint without logging the original US endpoint failure. If the EU endpoint also fails, the error will be misleading. Add logging before the EU retry and proper error handling if both endpoints fail.
| # Call EU endpoint if US fails | |
| Set-JcUrl -Region "EU" | |
| $baseUrl = "$($global:JCUrl)/api/search/systemusers" | |
| $Response = Invoke-WebRequest -Method 'Post' -Uri $baseUrl -Headers $Headers -Body $Body -UseBasicParsing | |
| $Results = $Response.Content | ConvertFrom-Json | |
| $StatusCode = $Response.StatusCode | |
| $usError = $_ | |
| Write-ToLog -Message "US endpoint failed: $($usError.Exception.Message)" -Level Error -Step "Test-JumpCloudUsername" | |
| # Call EU endpoint if US fails | |
| try { | |
| Set-JcUrl -Region "EU" | |
| $baseUrl = "$($global:JCUrl)/api/search/systemusers" | |
| $Response = Invoke-WebRequest -Method 'Post' -Uri $baseUrl -Headers $Headers -Body $Body -UseBasicParsing | |
| $Results = $Response.Content | ConvertFrom-Json | |
| $StatusCode = $Response.StatusCode | |
| } catch { | |
| $euError = $_ | |
| Write-ToLog -Message "EU endpoint also failed: $($euError.Exception.Message)" -Level Error -Step "Test-JumpCloudUsername" | |
| $Results = $null | |
| $StatusCode = $null | |
| } |
| # Call EU endpoint if US fails | ||
| Set-JcUrl -Region "EU" | ||
| $baseUrl = "$($global:JCUrl)/api/organizations/$($orgID)" | ||
| $Request = Invoke-WebRequest -Uri "$($baseUrl)?limit=$($limit)&skip=$($skip)" -Method Get -Headers $Headers -UseBasicParsing |
There was a problem hiding this comment.
The catch block silently retries with the EU endpoint without logging the failure or re-throwing if the EU endpoint also fails. This pattern appears twice in this function and should include proper error handling for both failures.
| Set-JcUrl -Region "EU" | ||
| $baseUrl = "$($global:JCUrl)/api/organizations" | ||
| $Request = Invoke-WebRequest -Uri "$($baseUrl)?limit=$($limit)&skip=$($skip)" -Method Get -Headers $Headers -UseBasicParsing |
There was a problem hiding this comment.
Similar to other try/catch blocks in this PR, the EU endpoint retry lacks error logging and handling if the retry also fails. The user will not receive clear feedback about which region failed or why.
| Set-JcUrl -Region "EU" | |
| $baseUrl = "$($global:JCUrl)/api/organizations" | |
| $Request = Invoke-WebRequest -Uri "$($baseUrl)?limit=$($limit)&skip=$($skip)" -Method Get -Headers $Headers -UseBasicParsing | |
| try { | |
| Set-JcUrl -Region "EU" | |
| $baseUrl = "$($global:JCUrl)/api/organizations" | |
| $Request = Invoke-WebRequest -Uri "$($baseUrl)?limit=$($limit)&skip=$($skip)" -Method Get -Headers $Headers -UseBasicParsing | |
| } catch { | |
| Write-Verbose "API key validation failed for EU region: $($_.Exception.Message)" | |
| throw "API key validation failed for both US and EU regions: $($_.Exception.Message)" | |
| } |
[skip ci] Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…voke.ps1 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Provider.ps1 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ontextAPI.ps1 Okay taking this suggestion and applying it Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Issues
https://jumpcloud.atlassian.net/jira/software/c/projects/CUT/boards/147?selectedIssue=CUT-4947
https://jumpcloud.atlassian.net/jira/software/c/projects/CUT/boards/147?selectedIssue=CUT-4951
https://jumpcloud.atlassian.net/jira/software/c/projects/CUT/boards/147?selectedIssue=CUT-4954