我们建议使用一个特定的脚本,在你的设备上成功部署TeamViewer 。

在这篇文章中,我们将向你展示我们推荐的脚本,并解释每个参数的含义。

本文适用于想要在其 Windows 设备上部署 TeamViewer (版本 15 或更新版本)的 Corporate 和 Tensor 许可证持有者。

推荐的脚本

🚨重要提示:请确保将[your_xxx]替换为你自己的值。

这个脚本分两步处理部署。

  1. 安裝包的安装操作
  2. 账户分配

TeamViewerHost 的脚本。

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

完整客户端(64位)的脚本。

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

完整客户端(32位)的脚本。

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

主要参数

我们将在此解释我们在推荐脚本中使用的参数。

▹msiexec.exe /i

安装该软件包。

▹/qn

允许无声安装。

▹"PATH_TO_MSI_FILE/TeamViewer_Host.msi"

定义了安装路径。

📌注意:它也可以在网络路径上。

▹CUSTOMCONFIGID=xxxxxx

适用于你的模块的定制。

📌注意:只适用于TeamViewer Host 。

▹SETTINGSFILE="YOURPATH\yourfilename.tvopt"

进口TeamViewer 选项。

欲了解更多信息,请阅读以下文章。

📄导出设置以便部署

📌注意:该值必须是一个有效的绝对本地路径或网络共享的路径。

🚨不要将此参数与IMPORTREGFILE结合使用。

▹ENABLEOUTLOOKPLUGIN=true or false

控制Outlook插件的取消/激活。

true: TeamViewer Outlook插件在安装后被激活(默认)。

false: TeamViewer Outlook插件在安装后被停用。

▹INSTALLSECURITYKEYREDIRECTION= 0 or 1

安装安全密钥重定向功能所需的虚拟设备驱动程序,该功能允许通过 TeamViewer会话使用智能卡和基于 fido 的设备

0:不安装驱动程序 (默认)

1:安装驱动程序

可选的命令行选项

您可以将其他选项添加到命令行中:

别名

Windows:

--device-alias=[<name>]

macOS:

-device_alias [<name>]

Linux:

--device-alias=[<name>]

设备列表中新设备的别名。 如果设备已在联系人列表中,则不会应用别名。 该属性可以采用以下值:

1) --alias(无值)

计算机的别名将是 TeamViewer ID

2) --alias Hello

计算机的别名将为“hello”

3) 未指定别名参数

此计算机的别名将为 %computername%

4) --别名%systemvariable%

别名将是使用的系统变量,例如 %username%

示例:

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

💡 提示:如果您想使用空格,则必须将所有内容放入“...”中,如下例所示:

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

桌面快捷方式

TeamViewer 更新后将阻止安装桌面快捷方式。

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

📌注意:如果您过去使用带有选项 DESKTOPSHORTCUTS=0 的 MSI 文件部署 TeamViewer Host,请首先使用以下命令卸载它:

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

Retries

--retries

在出现临时错误的情况下,会重新进行分配。请注意,每次尝试之间有1秒钟的等待时间。

Timeout

--timeout

设置用于所有分配尝试的总体超时(秒)。

例子:

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

错误代码

Error code Description Problem/solution

1

Invalid command line arguments

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

2

Signature verification error

-

3

Product not installed

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

400

(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.

401

(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.

402

(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.

403

(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.

404

(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.

405

(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.

406

(46 under Linux/FreeBSD)

MDv2Assignment - failed

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

407

(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.

408

(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.