From 702a23a7e573f9c25677a2dc5b201f2846cf9be1 Mon Sep 17 00:00:00 2001 From: BWMerlin <857916+BWMerlin@users.noreply.github.com> Date: Fri, 11 Nov 2022 20:32:09 +1000 Subject: [PATCH 1/2] Update WS1-ReEnroll.ps1 It appears that VMware blocks ICMP so if we just want to check that the server address is correct and responds then maybe using TCP and port 80 is a better option. --- .../Workspace ONE Re-Enrollment/WS1-ReEnroll.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UEM-Samples/Utilities and Tools/Windows/Migration and Re-Enrollment/Workspace ONE Re-Enrollment/WS1-ReEnroll.ps1 b/UEM-Samples/Utilities and Tools/Windows/Migration and Re-Enrollment/Workspace ONE Re-Enrollment/WS1-ReEnroll.ps1 index 50a5b6d9..7efb6162 100644 --- a/UEM-Samples/Utilities and Tools/Windows/Migration and Re-Enrollment/Workspace ONE Re-Enrollment/WS1-ReEnroll.ps1 +++ b/UEM-Samples/Utilities and Tools/Windows/Migration and Re-Enrollment/Workspace ONE Re-Enrollment/WS1-ReEnroll.ps1 @@ -839,7 +839,7 @@ elseif ($Arch -eq 'amd64') #Checking connection to target server before doing anything else Write-Log "Verifying connection to the target UEM server: $server" -$connectionStatus = Test-Connection -ComputerName $server -Quiet +$connectionStatus = Test-Connection -ComputerName $server -TcpPort 80 -Quiet if($connectionStatus) { Write-Log "Test connection passed." From cbbc12494fcc618d4372e51b09d911f41b64c1ad Mon Sep 17 00:00:00 2001 From: BWMerlin <857916+BWMerlin@users.noreply.github.com> Date: Wed, 1 Feb 2023 20:57:00 +1000 Subject: [PATCH 2/2] Changed Test-Connection to Test-NetConnection Test-Connection can fail as ICMP can be blocked. Due to PowerShell 5.x limitations -TcpPort is only available PS7.x so we cannot specify a port as it may not work when using PS5.x which is the minimum version we can expect in production. We can get around this by using Test-NetConnection which gives us access to -Port where we can use port 443 as port 80 is blocked in my testing. --- .../Workspace ONE Re-Enrollment/WS1-ReEnroll.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UEM-Samples/Utilities and Tools/Windows/Migration and Re-Enrollment/Workspace ONE Re-Enrollment/WS1-ReEnroll.ps1 b/UEM-Samples/Utilities and Tools/Windows/Migration and Re-Enrollment/Workspace ONE Re-Enrollment/WS1-ReEnroll.ps1 index 7efb6162..47daa169 100644 --- a/UEM-Samples/Utilities and Tools/Windows/Migration and Re-Enrollment/Workspace ONE Re-Enrollment/WS1-ReEnroll.ps1 +++ b/UEM-Samples/Utilities and Tools/Windows/Migration and Re-Enrollment/Workspace ONE Re-Enrollment/WS1-ReEnroll.ps1 @@ -839,7 +839,7 @@ elseif ($Arch -eq 'amd64') #Checking connection to target server before doing anything else Write-Log "Verifying connection to the target UEM server: $server" -$connectionStatus = Test-Connection -ComputerName $server -TcpPort 80 -Quiet +$connectionStatus = Test-NetConnection -ComputerName $server -Port 443 -InformationLevel Quiet if($connectionStatus) { Write-Log "Test connection passed."