You can push the TeamViewer clients to your devices via command line. Here is how to proceed.

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

How to assign a device via command line

  1. Open the CMD.
  2. Navigate to your TeamViewer installation folder.
  3. Enter the following command (indicated below) into the command line.
  4. Press Enter on your keyboard.
  5. (optional) Type 
echo %errorlevel%

into the command line to verify if the process was successful:

  • If the assignment was successful, the value "0" should be returned to the command line.
  • Any other return value indicates a problem that occurred during the assignment. For more information, please refer to the Error codes section.

Windows

TeamViewer.exe assignment --id paste_your_assignment_id_here 

Example: 

TeamViewer.exe assignment --id 0001CoBBChARKJtw_okR6o_fJ7AisynpEigIACAfAgAJAOjwtNCVK_JiM5lVdgdfguSk-gQ= 

macOS

Host module

sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -assignment_id paste_your_assignment_id_here

Example:

sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -assignment_id 0001CoBBChARKJtw_okR6o_fJ7AisynpEigIACAfAgAJAOjwtNCVK_JiM5lVdgdfguSk-gQ=

Full client

sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -assignment_id paste_your_assignment_id_here

Example:

sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -assignment_id 0001CoBBChARKJtw_okR6o_fJ7AisynpEigIACAfAgAJAOjwtNCVK_JiM5lVdgdfguSk-gQ=

Linux

sudo teamviewer assignment --id paste_your_assignment_id_here 

Example:

sudo teamviewer assignment --id 0001CoABChARKJtw_okR6o_fJ7AisynpEigIACAfAgAJAO4PLaOBrqNDgr6jwtNCVK_JiM5lVdgdfgYo3uQ3pGkAbX8bo_VqPw1Rt61-RLe9AKSwZ14uwOXtUN7FYflrHbWAqRKBF0h8V18ldMcVT1rLFedyWVafv1zlRWmVZRKH3IAEQouSk-gQ=

How to update/overwrite an assignment

If you have an assigned device already and execute the assignment via the command line again, the device assignment gets overwritten by the new one. Overwriting implies that the old assignment is deleted, and already assigned managers or policies will be lost.

📌Note: The TeamViewer policy "prevents removal of assignment" also prevents a new assignment on an already assigned device.