Assign a device via command line - 8/9 - TeamViewer Support
<main>
<article class="userContent">
<p><br></p><p>You can push the TeamViewer clients to your devices via command line. Here is how to proceed.</p><div class="blockquote"><div class="blockquote-content"><p class="blockquote-line"><em>This article applies to </em><a href="https://service.teamviewer.com/en-de/overview" rel="nofollow noreferrer ugc"><em>Corporate </em></a>and<em> </em><a href="https://www.teamviewer.com/en/teamviewer-tensor/" rel="nofollow noreferrer ugc"><em>Tensor</em></a><em> license holders who want to deploy TeamViewer (version 15 or newer) on their Windows devices.</em></p></div></div><p><br></p><h3></h3><h2 data-id="how-to-assign-a-device-via-command-line">How to assign a device via command line</h2><ol><li>Open the CMD.</li><li>Navigate to your TeamViewer installation folder.</li><li>Enter the following command (indicated below) into the command line.</li><li>Press <strong>Enter</strong> on your keyboard.</li><li><em>(optional)</em> Type </li></ol><pre class="code codeBlock" spellcheck="false" tabindex="0">echo %errorlevel%
</pre><p>into the command line to verify if the process was successful:</p><ul><li>If the assignment was successful, the value "0" should be returned to the command line.</li><li>Any other return value indicates a problem that occurred during the assignment. For more information, please refer to the <a href="https://community.teamviewer.com/English/kb/articles/109373-deploy-teamviewer-host-or-full-client-9-9#error-codes" rel="nofollow noreferrer ugc">Error codes</a> section.</li></ul><p><br></p><h3 data-id="windows">Windows</h3><pre class="code codeBlock" spellcheck="false" tabindex="0">TeamViewer.exe assignment --id paste_your_assignment_id_here
</pre><p>Example: </p><pre class="code codeBlock" spellcheck="false" tabindex="0">TeamViewer.exe assignment --id 0001CoBBChARKJtw_okR6o_fJ7AisynpEigIACAfAgAJAOjwtNCVK_JiM5lVdgdfguSk-gQ=
</pre><p><br></p><h3 data-id="macos">macOS</h3><h4 data-id="host-module">Host module</h4><pre class="code codeBlock" spellcheck="false" tabindex="0">sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -assignment_id paste_your_assignment_id_here
</pre><p>Example:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -assignment_id 0001CoBBChARKJtw_okR6o_fJ7AisynpEigIACAfAgAJAOjwtNCVK_JiM5lVdgdfguSk-gQ=
</pre><h4 data-id="full-client">Full client</h4><pre class="code codeBlock" spellcheck="false" tabindex="0">sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -assignment_id paste_your_assignment_id_here
</pre><p>Example:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -assignment_id 0001CoBBChARKJtw_okR6o_fJ7AisynpEigIACAfAgAJAOjwtNCVK_JiM5lVdgdfguSk-gQ=
</pre><p><br></p><h3 data-id="linux">Linux</h3><pre class="code codeBlock" spellcheck="false" tabindex="0">sudo teamviewer assignment --id paste_your_assignment_id_here
</pre><p>Example:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">sudo teamviewer assignment --id 0001CoABChARKJtw_okR6o_fJ7AisynpEigIACAfAgAJAO4PLaOBrqNDgr6jwtNCVK_JiM5lVdgdfgYo3uQ3pGkAbX8bo_VqPw1Rt61-RLe9AKSwZ14uwOXtUN7FYflrHbWAqRKBF0h8V18ldMcVT1rLFedyWVafv1zlRWmVZRKH3IAEQouSk-gQ=
</pre><p><br></p><h3 data-id="-1"></h3><h2 data-id="how-to-updateoverwrite-an-assignment">How to update/overwrite an assignment</h2><p>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.</p><p><strong>📌Note: </strong>The TeamViewer policy "prevents removal of assignment" also prevents a new assignment on an already assigned device.</p>
</article>
</main>