本文讲解了如何在 macOS 操作系统版本在进行大规模部署安装,升级和卸载 TeamViewer Host 和 TeamViewer 完整版本。为了实现此目的,您需要具有有关macOS上命令行安装的基本知识。
本文适用于所有使用 15.x 软件版本和拥有 专业版或Tensor 订阅许可计划的 TeamViewer 客户。支持的macOS 版本为: 10.14,10.15, 11,12,13
安装标准主机客户端
所需的安装程序
- 通过单击“下载安装程序”并选择“ PKG(适用于macOS的主机和完整客户端)”,在TeamViewer 管理控制台中的“设计和部署”下下载文件。
- 解压缩压缩文件。
步骤
请在终端输入以下命令行:
sudo installer -pkg "Install TeamViewer_Host.pkg" -target /
参数 -target定义您要安装的路径。
安装标准主机客户端 - 静默推送
所需的安装程序
- 通过单击“下载安装程序”并选择“ PKG(适用于macOS的主机和完整客户端)”,在TeamViewer 管理控制台中的“设计和部署”下下载文件。
- 解压缩压缩文件。
步骤
1) 创建一个名为(例如:choices.xml)的XML文件,然后输入以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhostSilentInstaller</string>
</dict>
</array>
</plist>
2)(可选)验证您的配置是否将正确应用
- 执行以下命令
installer -showChoicesAfterApplyingChangesXML newChoices.xml -pkg Install\ TeamViewer Host.pkg -target /
- 这将导致输出看起来与此类似
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> ... </dict> <dict> ... </dict> <dict> <key>attributeSetting</key> <false/> <key>choiceAttribute</key> <string>visible</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <true/> <key>choiceAttribute</key> <string>enabled</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> </array> </plist>通过添加参数“-applyChoiceChangesXML <your_filename>.xml”在安装过程中应用配置
sudo installer -applyChoiceChangesXML choices.xml -pkg Install TeamViewer Host.pkg -target /
3) 如果您有 MDM 系统,则可以使用隐私首选项策略控制 (PPPC) 有效负载在系统首选项 ➜ 安全和隐私 ➜ 隐私中为 TeamViewer 推出辅助功能和完整磁盘访问权限。 您的用户仍然需要自己授予屏幕录制访问权限。 从 macOS 11 Big Sur 开始,您将需要使用带有 AllowStandardUserToSetSystemService 的 ScreenCapture PPPC 负载,以允许非管理员用户授予此权限。
配置您的MDM以推出“辅助功能”权限(根据您的MDM解决方案提供商的手册)。 可以在以下位置找到使用Mobile Iron进行MDM配置的示例:将Teamviewer应用程序添加到使用Mobile Iron的macOS Mohjave可访问性中。
安装自定义主机客户端
所需的安装程序
- 通过单击“下载安装程序”并选择“ PKG(适用于macOS的主机和完整客户端)”,在TeamViewer 管理控制台中的“设计和部署”下下载文件。
- 解压缩压缩文件。
步骤
- 创建新的自定义项或打开现有的自定义项(有关详细信息,请参见如何自定义主机)
- 从您的自定义主机复制ConfigurationID
- 打开终端或通过脚本执行pkg
- 在命令行中将ConfigurationID添加到文件名:
- sudo installer -pkg “TeamViewer _Host-idc<ConfigurationID>.pkg" -target /
参数汇总
自定义主机客户端 - 静默安装
所需的安装程序
- 通过单击“下载安装程序”并选择“ PKG(适用于macOS的主机和完整客户端)”,在TeamViewer 管理控制台中的“设计和部署”下下载文件。
- 解压缩压缩文件。
步骤
1) 创建一个名为(例如:choices.xml)的XML文件,然后输入以下内容:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> </array> </plist>2)(可选)验证您的配置是否将正确应用
- 执行以下命令行
installer -showChoicesAfterApplyingChangesXML newChoices.xml -pkg "TeamViewer_Host-idc<ConfigurationID>.pkg" -target /
- 这将导致输出看起来与此类似
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> ... </dict> <dict> ... </dict> <dict> <key>attributeSetting</key> <false/> <key>choiceAttribute</key> <string>visible</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <true/> <key>choiceAttribute</key> <string>enabled</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict> </array> </plist>通过添加参数“ -applyChoiceChangesXML <your_filename> .xml”在安装过程中应用配置
sudo installer -applyChoiceChangesXML choices.xml -pkg "TeamViewer _Host-idc<ConfigurationID>.pkg" -target /
3) 如果您有 MDM 系统,则可以使用隐私首选项策略控制 (PPPC) 有效负载在系统首选项➜ 安全和隐私 ➜ 隐私中为 TeamViewer 推出辅助功能和完整磁盘访问权限。 您的用户仍然需要自己授予屏幕录制访问权限。 从 macOS 11 Big Sur 开始,您将需要使用带有 AllowStandardUserToSetSystemService 的 ScreenCapture PPPC 负载,以允许非管理员用户授予此权限。
配置您的MDM以推出“辅助功能”权限(根据您的MDM解决方案提供商的手册)。 可以在以下位置找到使用Mobile Iron进行MDM配置的示例:将Teamviewer应用程序添加到使用Mobile Iron的macOS Mohjave可访问性中。
安装完整版本客户端
所需的安装程序
- 通过单击“下载安装程序”并选择“ PKG(适用于macOS的主机和完整客户端)”,在TeamViewer 管理控制台中的“设计和部署”下下载文件。
- 解压缩压缩文件。
步骤
- 打开终端或通过脚本执行pkg。
- 在终端中输入:sudo installer -pkg“ Install TeamViewer.pkg” -target /
sudo installer -pkg "Install TeamViewer.pkg" -target /
- 参数-target定义您要安装的路径。
- 在macOS上的安装过程中无法提供设置。
⚠在 macOS 上安装过程中无法提供设置。
完整版本客户端 - 静默安装
所需的安装程序
- 通过单击“下载安装程序”并选择“ PKG(适用于macOS的主机和完整客户端)”,在TeamViewer 管理控制台中的“设计和部署”下下载文件。
- 解压缩压缩文件。
步骤
1) 创建一个名为(例如:choices.xml)的XML文件,然后输入以下内容:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerSilentInstaller</string> </dict> </array> </plist>2)(可选)验证您的配置是否将正确应用
- 执行以下命令行
installer -showChoicesAfterApplyingChangesXML newChoices.xml -pkg Install\ TeamViewer.pkg -target /
- 这将导致输出看起来与此类似
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> ... </dict> <dict> ... </dict> <dict> <key>attributeSetting</key> <false/> <key>choiceAttribute</key> <string>visible</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <true/> <key>choiceAttribute</key> <string>enabled</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerSilentInstaller</string> </dict> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerSilentInstaller</string> </dict> </array> </plist>通过添加参数“ -applyChoiceChangesXML <your_filename> .xml”在安装过程中应用配置
sudo installer -applyChoiceChangesXML choices.xml -pkg Install TeamViewer.pkg -target /
3) 如果您有 MDM 系统,则可以使用隐私首选项策略控制 (PPPC) 有效负载在系统首选项 ➜ 安全和隐私 ➜ 隐私中为 TeamViewer 推出辅助功能和完整磁盘访问权限。 您的用户仍然需要自己授予屏幕录制访问权限。 从 macOS 11 Big Sur 开始,您将需要使用带有 AllowStandardUserToSetSystemService 的 ScreenCapture PPPC 负载,以允许非管理员用户授予此权限。
配置您的MDM以推出“辅助功能”权限(根据您的MDM解决方案提供商的手册)。 可以在以下位置找到使用Mobile Iron进行MDM配置的示例:将Teamviewer应用程序添加到使用Mobile Iron的macOS Mohjave可访问性中。
更新 TeamViewer 安装
更新TeamViewer 对应于安装所需的步骤:
- 安装Teamviewer的标准主机客户端版本
- 安装Teamviewer的自定义主机客户端版本
- 安装TeamViewer 的标准完整客户端版本
卸载 TeamViewer
卸载TeamViewer 的原因可能是您想从TeamViewer 主机客户端版本切换到完全客户端版本。
📌注意:您只能手动卸载TeamViewer
建议的卸载TeamViewer 的方法是使用Mac App Store中的AppCleaner:
- 启动 TeamViewer 应用程序。
- 打开 TeamViewer ➜ 首选项 ➜ 高级。
- 向下滚动直到卸载。
- (可选)选中删除配置文件复选框。
- 单击卸载。
- 当要求确认时单击确定。
该程序已被卸载。
执行帐户分配
先决条件
- TeamViewer 已安装。
- 启用了“从系统启动”选项。
- TeamViewer 服务正在运行!
- 分配工具和应用程序一起安装在
- /Applications/TeamViewer Host.app/Contents/Helpers/TeamViewer _Assignment
- (/Applications/TeamViewer .app/Contents/Helpers/TeamViewer _Assignment)。
步骤
- 在应分配的所有设备上以sudo特权运行分配工具。 为了在大规模部署方案中执行此操作,建议您使用脚本来调用具有所需参数的分配工具。
主机版本:
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -group <GROUP> -alias <COMPUTERNAME> -grant-easy-access
Full version:
sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN>
- 设备已分配给创建“自定义TeamViewer 主机”模块的帐户。
- (可选)为设备激活EasyAccess
分配选项
下列表格显示了可能的分配选项(都是可选的)。有些参数需要一个值(-aliasMyAlias)或者不需要值(-reassign)。这些选项需要添加到命令行。
- 如果您的参数值带有空格(例如,组名称),请使用“ <GROUP_NAME_WITH_BLANK>”。
- sudo /Applications/TeamViewer (Classic).app/Contents/Helpers/TeamViewer _Assignment -api-token <YOAPITOKEN> -group“我的群组” -alias“ $ ALIAS”
- 参数名称区分大小写
- 可以在ASSIGNMENTOPTIONS中为分配指定代理设置。 TeamViewer连接本身还有其他代理设置(在TeamViewer客户端选项中定义)。这些必须在ASSIGNMENTOPTIONS之外设置。
- 您还可以在命令中插入环境变量以进行安装/分配,以添加动态值,例如为别名。您可以使用$符号来使用环境变量。变量值中不应包含以下字符:$,@,`,´,并且变量应始终用引号引起来。
- 示例:
- 1. 导出 GROUP =“ MyGroup”
- 2. 导出 ALIAS =“ MyDevicename”
- 3. sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer _Assignment -api-token <YOAPITOKEN> -group“ $ GROUP” -alias“ $ ALIAS”
- 示例:
选项
便于您复制粘贴:
Option - 选项
Description - 描述
-api-token <YOUR_APITOKEN>
API Token in order to do the assignment to the correct account
-alias [<name>]
Alias for the new device in the computers & contacts list. If the device is already in the contact list, no alias will be applied. The parameter can take the following values:
- -alias (without value) → alias of the computer will be the teamviewerID sudo
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -alias -group MyGroup
- -alias hallo → alias of the computer will be "hello"
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -alias hello -group MyGroup
- alias parameter not specified → alias of this computer will be %computername%
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -group MyGroup
- -grant-easy-access
If you set this option, easy access is granted after the assignment (same as the "Grant easy access" option in the TeamViewermain window).
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -grant-easy-access -group MyGroup
- -reassign
Assigns the device to the account even if the device is already assigned to an account.
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -reassign -group MyGroup
- -group <name>
Name of the group to which the device will be added.
When the group doesn't exist, it will be automatically created.
If the device is already in the computers & contacts list in a different group, it won't be moved to the group.
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -group MyGroup
Only required if no custom host is used, as a default group is already defined in the custom configuration.
- -group-id <ID>
This option is an alternative to using the --group parameter if the group's id is known.
This might be useful in large customer environments as it speeds up the assignment process. Usually, using --group is sufficient.
Note that the ID must be prepended with a literal "g".
sudo /Applications/TeamViewer (Classic)Host.app/Contents/Helpers/TeamViewer (Classic)_Assignment -api-token <YOUR_APITOKEN> -group-id g123
- -wait <seconds>
With this parameter, the waiting time for the assignment can be specified in seconds. The default value of 30 (secs) should usually be sufficient.
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -wait 45 -group MyGroup
- -proxy <name>:<port>
Url of your proxy (only for the assignment) in the format <name>:<port>, e. g. --proxy yourproxy:3201
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw mypass -group MyGroup
🚨注意: URL without http://
- -proxy-user <name>
Username which is used for authentication against the proxy (only for the assignment).
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw mypass -group MyGroup
- -proxy-pw <password>
Password which is used for authentication against the proxy (only for the assignment).
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw mypass -group MyGroup
- -proxy-pw-base64 <encoded_password>
Same as --proxy-pw, but the password needs to be entered as a Base64 encoded string. Useful for passwords with special characters.
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw-base64 bXlwYXNz -group MyGroup
