If you are planning or designing VMware View with remote access, you would need to install and configure the VMware Security server. However, when configuring the View, you will need to key in the public IP address on the PCOIP External URL (as showed below).
In most cases, corporate would have fixed public IP address for the VDI deployment. If you still want to proceed without fixed public IP address, or leveraging broadband services, you will always need to update the public IP address when it's changed. So, in order to reduce the manual overhead, you can always write a simple script to automate the changes. I've wrote a simple Powershell script that update the public IP address and it will sleep every 15 minutes and continue again.
Below is the Powershell script. Copy and paste in a text file rename with .ps1.
#=====Script start========
while (1 -eq 1) {
# PowerShell If Statement To Test Ip Addresses
$Ip4th = "bigcloud.ddns.net"
$exPCoIP = Get-ConnectionBroker HORIZON02 | Select-object externalPCoIPURL
$Pingy = Get-WmiObject Win32_PingStatus -f "Address='$Ip4th'"
If($Pingy.StatusCode -eq 0) {
$BIGCLOUDIP = $Pingy.ProtocolAddress + ":4172"
If ($exPCoIP.externalPCoIPURL.ToString() -eq $BIGCLOUDIP) {
Write-Host $(get-date -f MM-dd-yyyy_HH_mm_ss) ": IP Address has not changed-" $BIGCLOUDIP
}
else {
Update-ConnectionBroker -broker_id HORIZON02 -ExternalPCoIPUrl $BIGCLOUDIP
Write-Host $(get-date -f MM-dd-yyyy_HH_mm_ss) ": IP Address Changed-" $BIGCLOUDIP
}
}
else
{Echo "Failed"
}
start-sleep -seconds 300
# Update every 5 minutes
}
#=====Script end========
In most cases, corporate would have fixed public IP address for the VDI deployment. If you still want to proceed without fixed public IP address, or leveraging broadband services, you will always need to update the public IP address when it's changed. So, in order to reduce the manual overhead, you can always write a simple script to automate the changes. I've wrote a simple Powershell script that update the public IP address and it will sleep every 15 minutes and continue again.
Below is the Powershell script. Copy and paste in a text file rename with .ps1.
#=====Script start========
while (1 -eq 1) {
# PowerShell If Statement To Test Ip Addresses
$Ip4th = "bigcloud.ddns.net"
$exPCoIP = Get-ConnectionBroker HORIZON02 | Select-object externalPCoIPURL
$Pingy = Get-WmiObject Win32_PingStatus -f "Address='$Ip4th'"
If($Pingy.StatusCode -eq 0) {
$BIGCLOUDIP = $Pingy.ProtocolAddress + ":4172"
If ($exPCoIP.externalPCoIPURL.ToString() -eq $BIGCLOUDIP) {
Write-Host $(get-date -f MM-dd-yyyy_HH_mm_ss) ": IP Address has not changed-" $BIGCLOUDIP
}
else {
Update-ConnectionBroker -broker_id HORIZON02 -ExternalPCoIPUrl $BIGCLOUDIP
Write-Host $(get-date -f MM-dd-yyyy_HH_mm_ss) ": IP Address Changed-" $BIGCLOUDIP
}
}
else
{Echo "Failed"
}
start-sleep -seconds 300
# Update every 5 minutes
}
#=====Script end========
In order to run this powershell ps1 file, you need to run in the powershell command prompt. Launch the powershell and run this command first to add the VMware View PowerCLI in to the shell.
Now, you can run the ps1 file with powershell as shown below.
I've set the sleep timeout 5 minutes. Obviously, you might want to set it longer due to the DNS TTL. You can further improve this by resetting the DNS cache if needed.
Comments
Post a Comment