Search code examples
powershellservercommand-line-argumentsvnc-viewer

Pass IP into VNC Viewer


I'm trying to use VNC Viewer and pass in the server IP I need it to use. The trouble is I can't figure out the syntax of the -ArgumentList to do it properly.

Start-Process -Filepath "VNCViewer\viewer.exe" -ArgumentList "<hostname>=<$IP>"

Solution

  • The vncviewer documentation lists the syntax as

    vncviewer snoopy connects to display 0 on ‘snoopy’

    So in your case, you would pass the computer name (IP) as the only argument... like this:

    $IP = "192.168.1.1"
    Start-Process -Filepath "VNCViewer\viewer.exe" -ArgumentList $IP