Setting Up for Linux Desktops

Table Of Contents
n
User password for the Linux VM
n
Login name of an AD user that is authorized to join machines to the domain
n
Password of the authorized AD user
Script Content
<#
.SYNOPSIS
run command "sudo /usr/bin/net ads join" via SSH
.DESCRIPTION
The tool is to run the command "sudo /usr/bin/net ads join" to join Linux machine to AD via SSH
.NOTES
#>
#------------------------- 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]::SecureStringToBST
R($input))
}
else
{
$input = Read-Host
}
[Console]::ResetColor()
return $input
}
function Check_SSH_Client
{
Param($IsPlink, $IsPSCP)
if ($IsPlink)
{
if (Test-Path ".\plink.exe")
{
write-host -ForeGroundColor Yellow 'SSH client "plink.exe" found'
}
else
{
write-host -ForeGroundColor Red 'SSH client "plink.exe" not found, please download from its
official web site'
exit
Setting Up Horizon 7 for Linux Desktops
VMware, Inc. 92