We recommend using a specific script to deploy TeamViewer successfully on your devices.

In this article, we will show you our recommended script and explain the meaning of each parameter.

This article applies to Corporate and Tensor license holders who want to deploy TeamViewer (version 15 or newer) on their Windows devices.

Recommended scripts

Important note: Please make sure to replace [your_xxx] with your own values.

This script processes the deployment in two steps:

  1. Installation of the package
  2. Account assignment

Script for the TeamViewer Host:

timeout /t 30 /nobreak
"C:\Program Files (x86)\TeamViewer\TeamViewer.exe" assignment --id YOUR_ASSIGNMENT_ID

Script for the Full client (64-bit):

start /wait MSIEXEC.EXE /i "PATH_TO_MSI_FILE\TeamViewer_Full.msi" /qn
timeout /t 30 /nobreak
"C:\Program Files\TeamViewer\TeamViewer.exe" assignment --id YOUR_ASSIGNMENT_ID

Script for the Full client (32-bit):

start /wait MSIEXEC.EXE /i "PATH_TO_MSI_FILE\TeamViewer_Full.msi" /qn
timeout /t 30 /nobreak
"C:\Program Files (x86)\TeamViewer\TeamViewer.exe" assignment --id YOUR_ASSIGNMENT_ID

Main parameters

We will explain here the parameters we used in our recommended scripts:

msiexec.exe /i

Installs the package.


Allows the silent installation.


Defines the installation path.

📌Note: It can also be on a network path.


Applies your module's customization.

📌Note: This only applies to the TeamViewer Host.


Imports TeamViewer options.

For more information, please read the following article: Export settings for deployment

📌Note: The value must be a valid absolute local path or a path to a network share. 

⚠Don't use this parameter in combination with IMPORTREGFILE.


Controls the de-/activation of the Outlook plugin

true: The TeamViewer Outlook plugin is activated after installation (default)

false: The TeamViewer Outlook plugin is deactivated after the installation


Installs a virtual device driver required for the security key redirection feature that allows the use of smart cards and fido-based devices through a TeamViewer session

0: Does not install the driver (Default)

1: Installs the driver

Optional command line options

There are additional options you can add to your command line:


For Windows:


For macOS:

-device_alias [<name>]

For Linux:


Alias for the new device in the Device list. No alias will be applied if the device is already in the contact list. The property can take the following values:

  • --alias (without value)alias of the computer will be the TeamViewer ID
  • --alias helloalias of the computer will be "hello"
  • Alias parameter not specifiedalias of this computer will be %computername%
  • --alias %systemvariable%alias will be the used system variable e.g. %username%


"C:\Program Files\TeamViewer\TeamViewer.exe" assignment --id 123 --device-alias=%COMPUTERNAME%-%USERNAME%

💡 Hint: If you want to use spaces, you have to put everything in "..." like in the following example:

"C:\Program Files\TeamViewer\TeamViewer.exe" assignment --id 123 --device-alias="%COMPUTERNAME% test %USERNAME%"

Desktop Shortcut

Will prevent the desktop shortcuts to be installed after a TeamViewer update.

msiexec /i "Path\To\TeamViewer.msi" /qn ADDLOCAL=ALL REMOVE=f.DesktopShortcut

📌Note: If you deployed the TeamViewer Host in the past using the MSI file with the option DESKTOPSHORTCUTS=0, please first uninstall it using:

msiexec /i "Path\To\TeamViewer.msi" /qn REMOVE=f.DesktopShortcut



The assignment is retried in case of temporary errors. Note that there is a waiting time of 1 second between each try.



Set the overall timeout in seconds used for all assignment tries.


TeamViewer.exe assignment --id YOUR_ASSIGNMENT_ID
--retries=3 --timeout=120

Error codes

Error code Description Problem/solution


Invalid command line arguments

You seem to have misspelled or used a wrong command.  Check your command and try again.


Signature verification error



Product not installed

TeamViewer is not installed. Install TeamViewer before doing an assignment.


(40 under Linux/FreeBSD)

MDv2Assignment - invalid argument

There seems to be an error in the command line syntax or an invalid assignment ID is used. Please check your overall command line syntax and verify that the copied assignment ID is a valid configuration from the Management Console.


(41 under Linux/FreeBSD)

MDv2Assignment - service not running

The assignment can't be done because TeamViewer is not running properly. Please verify that the TeamViewer service is running.


(42 under Linux/FreeBSD)

MDv2Assignment - service incompatible version

The TeamViewer service is incompatible with the executed TeamViewer client version. It seems that the installation wasn't completed properly. Please check the installation and if necessary re-install TeamViewer again.


(43 under Linux/FreeBSD)

MDv2Assignment - not online

The TeamViewer client could not connect to the TeamViewer cloud in order to assign your device. Please check if the client is online and if your internet connection works properly and re-try the assignment. Consider using the retries option on the command line interface if that happens frequently.


(44 under Linux/FreeBSD)

MDv2Assignment - already running

Another assignment process is already running. Please check the status of that assignment. You can do that for example by checking if the device is already registered as a managed device in the Management Console.


(45 under Linux/FreeBSD)

MDv2Assignment - timeout

Your assignment attempt was timed out. Please try again. Consider increasing the timeout on the command line interface in case this happens frequently and/or the network is unstable e.g. mobile ones.


(46 under Linux/FreeBSD)

MDv2Assignment - failed

Your assignment failed due to unknown reasons. Please save your logs and contact support.


(47 under Linux/FreeBSD)

MDv2Assignment - access denied

You don't have the necessary permission to execute an assignment. Ensure that your user has local administrator rights.


(48 under Linux/FreeBSD)

MDv2Assignment - Denied by policy

The TeamViewer policy active on this device prevents removing the existing assignment state. Please disable the policy in the Management Console.

Note: Reassigning implicitly removes the existing state and is therefore also denied.