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

Hyper-V Set CompatibilityForMigrationEnabled

$vmName='TESTVM' function enableCpuCompatibility($vmName){ $compatibilityForMigration=(Get-VMProcessor $vmName).CompatibilityForMigrationEnabled if(!$compatibilityForMigration){ $vmIsRunning=(get-vm $vmname).State -eq 'Running' if($vmIsRunning){stop-vm $vmName} Set-VMProcessor$vmName -CompatibilityForMigrationEnabled 1…

PowerShell: Script to Apply Windows Update on 2016 Server

8/7/2020: there's a more updated version available here. # Update-Remote-Windows-2016-Servers.ps1$servers="SERVER1","SERVER2"function applyWindowsUpdates{ [CmdletBinding()] param ( [parameter(Mandatory=$true,Position=1)]…

Apache HTTPd

# Install Apacheyum install httpd# Configure Apachevim /etc/httpd/conf/httpd.conf##### Change portNameVirtualHost 127.0.0.1:8080Listen 127.0.0.1:8080######### Set DocumentRootDocumentRoot "/var/www/kimconnect"######…