この記事では、macOSの一括導入シナリオでTeamViewer Host モジュールとTeamViewer フルバージョンをインストール、更新、アンインストールする方法について説明します。これを実現するためには、macOS のコマンドラインインストールに関する基本的な知識が必要です。
この記事は、バージョン15.x以降を使用しているCorporateおよびTensorのライセンスを持つすべてのTeamViewer (Classic)ユーザーに適用されます。サポートされているMacOSのバージョン:10.14, 10.15, 11, 12, 13
TeamViewerの標準Hostバージョンのインストール
必要なインストーラー
- TeamViewer Host.pkg:TeamViewer (Classic) Management Consoleの「カスタマイズ&配布」で「インストーラのダウンロード」をクリックし、[PKG (Host & Full Client for macOS)]を選択してファイルをダウンロードします。
- 圧縮ファイルを解凍します。
手順
次のコマンドをターミナルに入力します。
sudo installer -pkg "TeamViewer_Host.pkg" -target /
パラメーター-targetは、インストールを配置するパスを定義します。
TeamViewerの標準Hostバージョンのサイレントインストール
必要なインストーラー
- TeamViewer_Host.pkg:TeamViewer (Classic) Management Consoleの「カスタマイズ&配布」で「インストーラのダウンロード」をクリックし、[PKG (Host & Full Client for macOS)]を選択してファイルをダウンロードします。
- PKGを解凍します。
手順
1) XMLファイル(choices.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 ペイロードを使用する必要があります。
Mobile Ironを使用したアクセシビリティアクセスのMDM設定例は、こちらをご覧ください。
📄Mobile Ironを使用してTeamViewerアプリをmacOSに追加する方法
TeamViewerのカスタマイズされたHostバージョンのインストール
必要なインストーラー
- TeamViewerHost.pkg: TeamViewer (Classic) Management Console のデザイン&配布からインストーラーのダウンロードをクリックし、PKG (Host & Full Client for macOS)を選択してファイルをダウンロードします。
- PKGを解凍します。
手順
- 新しいカスタマイズを作成するか、既存のカスタマイズを開きます。(詳細については、Hostをカスタマイズする方法をご覧ください)
- カスタマイズしたHostからConfigurationIDをコピーします。
- ターミナルを開くか、スクリプトを使用してpkgを実行します。
- コマンドラインのファイル名にConfigurationIDを追加します。
- sudo installer -pkg "TeamViewer_Host-idc<ConfigurationID>.pkg" -target /
パラメータの概要
TeamViewerのカスタマイズされたHostバージョンのサイレントインストール
必要なインストーラー
- TeamViewer_Host.pkg:TeamViewer_Host.pkg: DD TeamViewer (Classic) Management Console のカスタマイズ&配布でインストーラのダウンロードをクリックし、PKG (Host & Full Client for macOS)を選択してファイルをダウンロードします。
- PKGを解凍します。
手順
1) XMLファイル(choices.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 ペイロードを使用する必要があります。
Mobile Ironを使用したアクセシビリティアクセスのMDM設定例は、こちらをご覧ください。
TeamViewerの標準バージョンのインストール
必要なインストーラー
- TeamViewer_Full.pkg: TeamViewer (Classic) Management Console のカスタマイズ&配布でインストーラのダウンロードをクリックし、PKG (Host & Full Client for macOS)を選択して、ファイルをダウンロードします。
- PKGを解凍します。
手順
- ターミナルを開くか、スクリプトを介して pkg を実行します。
- ターミナルに次のコマンドを入力します
sudo installer -pkg "TeamViewer_Full.pkg" -target /
パラメーター -target は、インストールを配置するパスを定義します。
⚠macOSでは、インストール時に設定を行うことはできません。
TeamViewerの標準バージョンのサイレントインストール
必要なインストーラー
- TeamViewer_Full.pkg: TeamViewer (Classic) Management Console のカスタマイズ&配布でインストーラのダウンロードをクリックし、PKG (Host & Full Client for macOS)を選択してファイルをダウンロードします。
- PKGを解凍します。
手順
1) XMLファイル(choices.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_Full.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>
3) パラメーター「-applyChoiceChangesXML <your_filename> .xml」を追加して、インストール中に構成を適用します。
sudo installer -applyChoiceChangesXML choices.xml -pkg Install\ TeamViewer_Full.pkg -target /
4) MDMシステムを使用している場合、プライバシー設定ポリシーコントロール(PPPC)ペイロードを使用して、システム環境設定➜ セキュリティとプライバシー➜ プライバシーで、TeamViewerのアクセシビリティとフルディスクアクセスをロールアウトすることが可能です。ユーザーは、画面録画のアクセス権を自分で許可する必要があります。macOS 11 Big Sur 以降では、管理者以外のユーザがこの権限を付与できるように、AllowStandardUserToSetSystemService を備えた ScreenCapture PPPC ペイロードを使用する必要があります。
Mobile Ironを使用したアクセシビリティアクセスのMDM設定例は、こちらをご覧ください。
TeamViewerインストールの更新
TeamViewerの更新は、インストールに必要な手順と同じです。
- Teamviewerの標準Hostクライアントバージョンをインストールします。
- TeamviewerのカスタマイズされたHostクライアントバージョンをインストールします。
- TeamViewerの標準フルクライアントバージョンをインストールします。
TeamViewerのアンインストール
TeamViewerをアンインストールする理由は、TeamViewer Hostクライアントバージョンからフルクライアントバージョンに切り替えることが考えられます。
📌注意:TeamViewerは手動でのみアンインストールできます。
TeamViewerをアンインストールする推奨方法
- TeamViewerアプリケーションを起動します。
- TeamViewer ➜ 環境設定 ➜ 詳細設定を開きます。
- アンインストールまで下方向にスクロールします。
- (オプション)設定ファイルの削除のボックスをオンにします。
- アンインストールをクリックします。
- 確認を求められたら、OKをクリックします。
以上で、プログラムはアンインストールされました。
割り当ての実行
前提条件
- TeamViewerはすでにインストールされています。
- オプションシステムで開始が有効になります。
- TeamViewerサービスが実行されています。
- 割り当てツールは、アプリケーションと一緒にインストールされます。
- /Applications/TeamViewer Host.app/Contents/Helpers/TeamViewer _Assignment
- (/Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment)
手順
- 割り当てる必要があるすべてのデバイスで、sudo特権で割り当てツールを実行します。大量展開シナリオでこれを行うには、スクリプトを使用して、必要なパラメーターを使用して割り当てツールを呼び出すことをお勧めします。
sudo /Applications/TeamViewer Host.app/Contents/Helpers/TeamViewer (Classic)_Assignment -api-token <YOUR_APITOKEN> -group <GROUP> -alias <COMPUTERNAME> -grant-easy-access
sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN>
- デバイスは、カスタムTeamViewer Hostモジュールを作成したアカウントに割り当てられます。
- 簡易アクセスは、デバイスに対して(オプションで)有効化されます。
割り当てオプション
次の表に、可能な割り当てオプションを示します(すべてオプションです)。
値が必要なパラメーター(–alias MyAlias)または値を必要としないパラメーター(–reassign)があります。
オプションはコマンドラインで追加する必要があります。
- 空白のあるパラメーター値(グループ名など)がある場合は、「<GROUP_NAME_WITH_BLANK>」を使用します。
- sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer _Assignment -api-token <YOUR_APITOKEN> -group "My Group" -alias "$ALIAS"
- パラメータ名は大文字と小文字が区別されます。
- プロキシ設定は、ASSIGNMENTOPTIONS内で割り当てに指定することができます。 TeamViewer 接続自体には追加のプロキシ設定があります(TeamViewerクライアントオプションで定義されています)。これらはASSIGNMENTOPTIONSの外部で設定する必要があります。
- インストール/割り当て用のコマンドに環境変数を挿入して、エイリアスなどの動的な値を追加することもできます。環境変数を使用するには、$-notationを使用します。次の文字を変数値に含めることはできません。$、@、 `、 ´、および変数は常に引用符で囲んで使用する必要があります。
- 例:
- export GROUP="MyGroup"
- export ALIAS = "MyDevicename"
- sudo /Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -group "$GROUP" -alias "$ALIAS"s
上記の表のコピー&ペースト用
-api-token <YOUR_APITOKEN>
正しいアカウントへの割り当てを行うためのAPIトークン
-alias [<name>]
コンピュータと連絡先リストの新しいデバイスのエイリアス。デバイスがすでに連絡先リストにある場合、エイリアスは適用されません。パラメータは次の値を取ることができます:
- -alias (without value) → alias of the computer will be the teamviewerID sudo
/Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -alias -group MyGroup
- -alias hallo → alias of the computer will be "hallo"
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
このオプションを設定すると、割り当て後に簡単なアクセスが許可されます(TeamViewerのメインウィンドウの「簡単なアクセス許可」オプションと同じです)。
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -grant-easy-access -group MyGroup
-reassign
デバイスがすでにアカウントに割り当てられている場合でも、デバイスをアカウントに割り当てます。
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -reassign -group MyGroup
-group <name>
デバイスを追加するグループの名前です。
グループが存在しない場合、自動的に作成されます。
デバイスが既に別のグループのコンピュータと連絡先リストに存在する場合、そのグループには移動されません。
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -group MyGroup
カスタム設定ですでに定義されているデフォルトグループが存在するため、カスタムHostが使用されていない場合にのみ必要です。
-group-id <ID>
このオプションは、グループのIDがわかっている場合は、--groupパラメーターを使用する代わりに使用できます。これは、非常に大規模な顧客環境では、割り当てプロセスのスピードアップに役立ちます。通常は--groupを使用すれば十分です。
IDの前には、リテラルな "g "を付けなければならないことに注意してください。
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -group-id g123
-wait <seconds>
このパラメータでは、割り当ての待ち時間を秒単位で指定することができます。通常はデフォルト値の30(秒)で十分です。
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -wait 45 -group MyGroup
-proxy <name>:<port>
プロキシのURL(割り当て時のみ)、フォーマットは <name>:<port>,
例: --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
⚠警告: http:// がないURL
-proxy-user <name>
プロキシとの認証に使用されるユーザー名(割り当て時のみ)
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <API TOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw mypass -group MyGroup
-proxy-pw<password>
プロキシとの認証に使用されるパスワード(割り当ての場合のみ)
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>
--proxy-pwと同じですが、パスワードはBase64でエンコードされた文字列として入力する必要があります。特殊文字を含むパスワードに有効です。
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token <YOUR_APITOKEN> -proxy yourproxy:3201 -proxy-user FooBar -proxy-pw-base64 bXlwYXNz -group MyGroup