Posted On July 10, 2019

PowerShell: Install TightVNC on Windows via CLI

kimconnect 0 comments
blog.KimConnect.com >> Codes >> PowerShell: Install TightVNC on Windows via CLI
Install VNC Server on the Remote Windows:
# Access Remote Server via WinRM
$SHERVERNAME = "SHERVER007"
$winRMHttp=5985
$winRMHttps=5986

# Check to ensure that port 5986 is operational
Test-NetConnection $SHERVERNAME -port $winRMHttp
Test-NetConnection $SHERVERNAME -port $winRMHttps

# Connect to remote server's WinRM instance
Enter-PSSession -ComputerName $SHERVERNAME -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck) #optional: -Credential (Get-Credential)
# Install Chocolatey if it's not already available
if (!(Get-Command choco.exe -ErrorAction SilentlyContinue)) {
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))}
# Install TightVNC without Password Authentication (defer to Console AD Auths)
choco install tightvnc -y --installArguments 'SET_USEVNCAUTHENTICATION=1 VALUE_OF_USEVNCAUTHENTICATION=0'
Install VNC Viewer on the client:
# Install only VNC Viewer
choco install tightvnc -ia "ADDLOCAL=Viewer"

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Monitor a Program Wizard for Its Task Completion

Once upon a time in the realm of SysAdmin endless green pastures, there were rampant…

Basic CSS: Use CSS Selectors to Style Elements

<h2 style="color: red">CatPhotoApp</h2><main><p>Click here to view more <a href="#">cat photos</a>.</p><a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange…

Add Chocolatey Private Repo

$privateRepo='kimconnectrepo' $privateRepoUrl='https://choco.kimconnect.net/chocolatey' $priority=1 # Set private repo source if it doesn't exist function addRepo{ param(…