Recommended scripts
Important note: Please make sure to replace [your_xxx] with your own values.
This script processes the deployment in two steps:
- Installation of the package
- Account assignment
Script for the TeamViewer Host (64-bit):
start /wait MSIEXEC.EXE /i "PATH_TO_MSI_FILE\TeamViewer_Host.msi" /qn CUSTOMCONFIGID=YOUR_CUSTOM_CONFIG_ID
timeout /t 30 /nobreak
"C:\Program Files\TeamViewer\TeamViewer.exe" assignment --id YOUR_ASSIGNMENT_ID
Script for the TeamViewer Host (32-bit):
start /wait MSIEXEC.EXE /i "PATH_TO_MSI_FILE\TeamViewer_Host.msi" /qn CUSTOMCONFIGID=YOUR_CUSTOM_CONFIG_ID
timeout /t 30 /nobreak
"C:\Program Files (x86)\TeamViewer\TeamViewer.exe" assignment --id YOUR_ASSIGNMENT_ID
Script for the TeamViewer 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 TeamViewer 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.
/qn
Allows the silent installation.
“PATH_TO_MSI_FILE\TeamViewer_Host.msi”
Defines the installation path.
Note: It can also be on a network path.
CUSTOMCONFIGID=xxxxxx
Applies your module's customization.
Note: This only applies to the TeamViewer Host.
SETTINGSFILE=”YOURPATH\yourfilename.tvopt”
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.
ENABLEOUTLOOKPLUGIN=true or false
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
INSTALLSECURITYKEYREDIRECTION= 0 or 1
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:
Alias
For Windows:
--device-alias=[<name>]
For macOS:
-device_alias [<name>]
For Linux:
--device-alias=[<name>]
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%
Example:
"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
Retries
--retries
The assignment is retried in case of temporary errors. Note that there is a waiting time of 1 second between each try.
Timeout
--timeout
Set the overall timeout in seconds used for all assignment tries.
Example:
TeamViewer.exe assignment --id YOUR_ASSIGNMENT_ID --retries=3 --timeout=120