Setting Up for Linux Desktops

Table Of Contents
n
Administrator login name for the vCenter Server
n
Administrator password for the vCenter Server
n
Administrator login name for the ESXi host
n
Administrator password for the ESXi host
n
User login name for the Linux VM
n
User password for the Linux VM
Script Content
<#
Upload the configuration files config and viewagent-custom.conf to Linux VMs
#>
#------------------------- Functions -------------------------
function GetInput
{
Param($prompt, $IsPassword = $false)
$prompt = $prompt + ": "
Write-Host $prompt -NoNewLine
[Console]::ForegroundColor = "Blue"
if ($IsPassword)
{
$input = Read-Host -AsSecureString
$input =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStrin
gToBSTR($input))
}
else
{
$input = Read-Host
}
[Console]::ResetColor()
return $input
}
#------------------------- Handle Input -------------------------
"-----------------------------------------------------"
write-host -ForeGroundColor Blue 'Please ensure your config file and viewagent-custom.conf file
are in current working directory'
$vcAddress = GetInput -prompt "Your vCenter address" -IsPassword $false
$vcAdmin = GetInput -prompt "Your vCenter admin user name" -IsPassword $false
$vcPassword = GetInput -prompt "Your vCenter admin user password" -IsPassword $true
"-----------------------------------------------------"
$hostAdmin = GetInput -prompt 'Your ESXi host admin user name, such as root' -IsPassword $false
$hostPassword = GetInput -prompt "Your ESXi admin user password" -IsPassword $true
"-----------------------------------------------------"
$guestUser = GetInput -prompt 'Your VM guest OS user name' -IsPassword $false
$guestPassword = GetInput -prompt 'Your VM guest OS user password' -IsPassword $true
"-----------------------------------------------------"
$csvFile = '.\CloneVMs.csv'
$setConfig = $false
$setCustomConf = $false
Setting Up Horizon 7 for Linux Desktops
80 VMware, Inc.