UltraVNC Deployment Script

Script copies UltraVNC to target client (C:\vnc\) and executes UltraVNC with configurable settings. Launches VNC Viewer afterwards and removes VNC (optional).

Requirements and Usage:
- Copy psexec.exe to C:\Windows
- Run the Powershell with Admin-Rights / elevated Console
- User has to be admin on the target and local machine
- Default password = 123

– Save the Script and create a folder on the same level called „UltraVNC“
– Copy UltraVNC Programm Files to the UltraVNC folder
– Run vnc_deploy.ps1 (elevated, user has to be admin on the targeted client)

 

The ACL part is variable if you use it in an Domain environment. Start uvnc_settings.exe and configure Domain Access with groups or edit the *ultravnc.ini and change to:

[ultravnc]
passwd=000000000000000000
passwd2=000000000000000000
[admin]
UseRegistry=0
MSLogonRequired=1
NewMSLogon=1

And change acl.txt

Download Script, VNC, PSexec

#PowershellScript vnc_deploy.ps1:

# Administrator Privilige needed for Execution Policy Change
Set-ExecutionPolicy RemoteSigned

write "---------------------------------------------"
write "VNC Remote Access"
write "---------------------------------------------"
write "(1) Connect without permission(1)"
write "(2) Ask user for permission (2)"
$q = read-host "(1/2)"
switch ($q)
{ 
"1" {
$Hostname_PS = read-host "Enter hostname"
write "---------------------------------------------"
write "Install VNC on remote host"
write "---------------------------------------------"
copy-item UltraVNC\ -dest \\$Hostname_PS\c$\vnc -recurse
write "Assigning Config"
copy-item \\$Hostname_PS\c$\vnc\NOprompt_ultravnc.ini -dest \\$Hostname_PS\c$\vnc\ultravnc.ini -recurse
psexec \\$Hostname_PS C:\vnc\winvnc.exe -service loadinf=C:\vnc\NOprompt_ultravnc.ini
write "VNC copied to $Hostname_PS "
write "---------------------------------------------"
write "Assign security settings"
psexec \\$Hostname_PS C:\vnc\MSLogonACL.exe /i /o C:\vnc\acl.txt
write "starting VNC service"
psexec \\$Hostname_PS C:\vnc\winvnc.exe -install
start-sleep -s 5
write "---------------------------------------------"}
"2" {
$Hostname_PS = read-host "Enter hostname"
write "---------------------------------------------"
write "Install VNC on remote host"
write "---------------------------------------------"
copy-item UltraVNC\ -dest \\$Hostname_PS\c$\vnc -recurse
write "VNC copied to $Hostname_PS"
write "---------------------------------------------"
write "Assigning Config" 
copy-item \\$Hostname_PS\c$\vnc\prompt_ultravnc.ini -dest \\$Hostname_PS\c$\vnc\ultravnc.ini -recurse
psexec \\$Hostname_PS C:\vnc\winvnc.exe -service loadinf=C:\vnc\prompt_ultravnc.ini

write "Assign security settings"
psexec \\$Hostname_PS C:\vnc\MSLogonACL.exe /i /o C:\vnc\UltraVNC\acl.txt
write "Starting VNC service"
psexec \\$Hostname_PS C:\vnc\winvnc.exe -install
start-sleep -s 5
write "---------------------------------------------"}}


write "Connecting to $Hostname_PS"
& UltraVNC\vncviewer.exe -connect $Hostname_PS -quickoption 7
write "---------------------------------------------"
write "---------------------------------------------"
write "---------------------------------------------"
write "---------------------------------------------"
$Pause = read-host "Enter any to uninstall VNC"
write $Pause
psexec \\$Hostname_PS C:\vnc\winvnc.exe -uninstall
start-sleep -s 5
Remove-Item \\$Hostname_PS\c$\vnc -recurse
write "---------------------------------------------"
2+

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.