Using Cloud connectivity tokens

Follow

CloudConnectivityToken
CloudConnectivityToken.png

To enable bulk deployment of your RealVNC Servers to the RealVNC Connect cloud, RealVNC Server can be joined to the cloud from the command line or via a script using a cloud connectivity token, instead of requiring a user to sign in to the RealVNC Server with their RealVNC account.

Computers can also be added to groups using cloud connectivity tokens if you need to restrict discovery of the computer to certain members of the team. 

Generating a cloud connectivity token 

Cloud connectivity tokens can be found under the Deployment page of your RealVNC account. To generate a new cloud connectivity token use the Generate Token button in the Cloud connectivity tokens section.

mceclip1.png

Next, select how long the token will be valid for; either one hour or indefinitely.

 mceclip0.png

The token will then be generated and will appear in the token column of the table.

mceclip0.png

Once generated the token can then be applied either by using the command line or via a script file.

Deploying a cloud connectivity token

Please note that <TOKEN> should be replaced with the token you generated in the Deployment page of your RealVNC Account for both deployment options.

Alternatively, you can download a JSON file containing your token from the Deployment page, and replace <TOKEN> with the path to the downloaded JSON file.

Command line

Windows

In an administrator / elevated command prompt run:

"%programfiles%\RealVNC\VNC Server\vncserver.exe" -service -joinCloud <TOKEN>

Mac

In Terminal:

sudo /library/vnc/vncserver -service -joinCloud <TOKEN>

Linux

In a terminal application run:

sudo vncserver-x11 -service -joinCloud <TOKEN>

Script file

Windows (Powershell)

To deploy a cloud connectivity token using a Powershell script please create a new Powershell file with the following contents:

For VNC Server 6.11.0 and later:

if ((& 'C:\Program Files\RealVNC\VNC Server\vncserver.exe' -service -cloudstatus | ConvertFrom-JSON| Select-Object -ExpandProperty CloudJoined) -eq $false){
& "C:\Program Files\RealVNC\VNC Server\vncserver.exe" -service -joinCloud <TOKEN>
}

For VNC Server 6.10.1 and earlier:

if((Test-Path "C:\ProgramData\RealVNC-Service\vncserver.d\CloudCredentials.bed") -eq $False){
& "C:\Program Files\RealVNC\VNC Server\vncserver.exe" -service -joinCloud <TOKEN>
}

Windows (Command Prompt/batch)

To deploy a cloud connectivity token using a batch script please create a new batch file with the following contents:

For VNC Server 6.11.0 and later:

@ECHO OFF
"C:\Program Files\RealVNC\VNC Server\vncserver.exe" -service -cloudstatus | findstr CloudJoined | findstr false 1>nul
IF %ERRORLEVEL% EQU 0 (
"C:\Program Files\RealVNC\VNC Server\vncserver.exe" -service -joinCloud <TOKEN>
)

For VNC Server 6.10.1 and earlier:

@ECHO OFF
IF NOT EXIST C:\ProgramData\RealVNC-Service\vncserver.d\CloudCredentials.bed (
  "C:\Program Files\RealVNC\VNC Server\vncserver.exe" -service -joinCloud <TOKEN>
)

Additional Options

Adding a computer to a group

To add a computer to a group using a token the option -joinGroup <GROUP> must be added to the end of the joinCloud command.

You need to replace <GROUP> with the name of the group the computer is to be added to. Group names can be referenced from the Computers page of your RealVNC account and must exist before they can be used by -joinGroup.

You can also specify that RealVNC Server should be added to multiple groups, by adding -joinGroup <GROUP> for each group you want to add RealVNC Server to.

Changing the name VNC Server uses when joining the cloud

VNC Server will use the computer's hostname when joining the cloud by default. To use a different name the option -joinName <NAME> must be added to the end of the joinCloud command.

You need to replace <NAME> with the name that you would like to use for the computer.

Negotiating proxy servers

If there’s an intermediate proxy server when you add a computer to a team, supply location and credentials. For example, under Windows:

  • SOCKS proxy server:
    vncserver.exe -service -proxyserver=socks://SERVER:PORT -proxyusername=NAME -proxypassword=OBFUSCATED-PWD -joinCloud TOKEN
  • HTTP proxy server:
    vncserver.exe -service -proxyserver=http://SERVER:PORT -proxyusername=NAME -proxypassword=OBFUSCATED-PWD -joinCloudTOKEN

If the proxy server requires a password, first obfuscate that password using the vncpasswd utility, located in the same directory as VNC Server. Run the following command, and follow the instructions:

vncpasswd -print

Was this article helpful?
5 out of 20 found this helpful

Comments

3 comments
  • Hello. Is there any plans on adding this to ADMX files?

    0
    Comment actions Permalink
  • Hi Orkhan,

    Thanks for posting! This is something we're looking into adding, hopefully we'll have more news soon.

    0
    Comment actions Permalink
  • Hi, is it possible to add the cloud connectively token to an MST, similar to how adding offline license to the OFFLINELICENSE property?

    0
    Comment actions Permalink

Please sign in to leave a comment.