TeamViewer - Deploy on Windows Machines (Intune)_AD

About

This document describes how to deploy TeamViewer from Intune to all the company devices. This one is a bit complicated, pay attention.

To begin

1, First of all, you’re going to need a Windows machine. TeamViewer](https://web.teamviewer.com/remote-support)).

Skip

1, Because company already have a licence and an account, we can skip these steps:

  1. ‘Create your company’
    (In case you need it: Create your company (with a Master account) - 1/10).

  2. ‘Add users to your company’
    (In case you need it: Active Directory Connector (AD Connector)).

  3. ‘Create your policy’
    (In case you need it: https://community.teamviewer.com/English/kb/articles/109369-create-your-policy-5-9).

  4. ‘Create a device group’
    (In case you need it: https://community.teamviewer.com/English/kb/articles/109370-create-a-managed-group-6-9).

Create your Rollout set-up

(In case you need it: https://community.teamviewer.com/English/kb/articles/109367-create-your-module-3-9).
1, Look for ‘Rollout set-up’, and click ‘Create configuration’.

2, Fill in configurations:

  1. Fill in name of the configuration, ‘The Company Name'. Click 'Continue’.

  2. Assign the group to connect TeamViewer too. Click ‘Continue’.

  3. Add the device manager (the user to manage the TeamViewer. Click ‘Continue’.

  4. Assign a policy. Click ‘Save’.

Create your Module

1, Again, make sure you are in TeamViewer. Then look for, and click the ‘Admin Settings’, then choose the option ‘Custom Modules’. Fill out the colourful squares in the picture below. The red colour squares are the important onces! The ‘Rollout set-up’ must be the company you made earlier in step number 2.

Download .msi installer

1, Go back to ‘Rollout set-up’, and click ‘Download installer’. Choose the option that suits your need. The file will download. Save it somewhere accessible on your windows machine. I suggest ‘C:\Users\username\Documents\TeamViewer’. Then for easy understanding, I also suggest you name the file something similar to ‘teamviewer_host.msi’.

Get the Rollout Configuration ID (assignment ID)

1, See, this is where things get confusing. According to the big Internet, you should be able to click 3 dots and copy the ‘Rollout configuration’ directly from there. This does not work. However, you should be able to find it if you keep following the tutorial.
(NOTE: This screenshot underneath is just added to show that the ‘copy’ option does not exist'.)

2, Now this is the ‘right solution'. Click the link here https://login.teamviewer.com/nav/home. Click ‘Design & Deploy’, then ‘Assignment’, and then click the 'clipboard'. This should copy the same string in step 1.
(I hope,- to be tested!)

Write your script

1, Open a text editor in your windows machine. It doesn’t have to be a fancy one, ‘Notepad’ is more than enough. Type in whatever you want, just so you can save the file ('Save as'). The script itself will be typed in later. Make sure you replace the ‘.txt’ with ‘.bat’! Click 'save'.
NOTE 1: The filename is used often, make it descriptive!
NOTE 2: This file have to be saved in the same place as the .msi installer file (‘C:\Users\username\Documents\TeamViewer’.).

2, Now you can create your script text. After some testing and tweaking, (06.02.2024) the most effective script is this:

1. taskkill /im teamviewer_service.exe /F

2. taskkill /im teamviewer.exe

3. ”%programfiles(x68)%”\TeamViewer\uninstall.exe” /S

4. timeout /t 30 /nobreak

5. MSIEXE.EXE /i “%~dp0\teamviewer_host.msi“ /qn CUSTOMCONFIG=6sbibi3 --id

6. timeout /t 30 /nobreak

Code Explanation

1. This command forcefully (/F) terminates (taskkill) the process with the image name (/im) "teamviewer_service.exe."
2. Similar to the first line, this command terminates the process of "teamviewer.exe."
3. This line is silently uninstalling TeamViewer using its uninstallation executable. The %programfiles(x86)% is an environment variable pointing to the Program Files (x86) directory on Windows. The /S flag indicates a silent uninstallation.
4. This command introduces a delay of 30 seconds (/t 30) with the /nobreak flag, which means the countdown cannot be interrupted by pressing a key.
5. This line installs TeamViewer using the Windows Installer (MSIEXE.EXE). The /i flag indicates installation, and the /qn flag makes the installation silent (no user interface). The CUSTOMCONFIG=6sbibi3 parameter is a custom configuration during installation. This custom configuration is found here:

Open
6. Another 30-second delay, like the fourth line.

Note: Still need to add a line in the script !!assignment ID!! and test it out!

Prepare to install script

1, Download the ‘Intune Content Prep Tool’ here.

2, The file will end up in your downloads. Install it.

3, Open the ‘Command Prompt’ as an administrator. Type in your ADuser and password.

4, Then type in the path to where you just saved the ‘Intune Content Prep Tool’ installed file. In this case, it is in the ‘Download’ folder. Then search for the files in the ‘Downloads’ folder and execute the ‘Intune Content Prep Tool’, like seen in the screenshot below.

5, Follow this mini-tutorial closely

The prompted text: What you write:
Please specify the source folder: C:\Users\username\Documents\TeamViewer
(Because this is where you saved the .msi file and the .bat file)
Please specify the setup file: C:\Users\username\Documents\TeamViewer\tutorial_teamviewer_host.bat
Please specify the output folder: C:\Users\username\Desktop
(You should not put the file in the same folder as the .msi and .bat file)
Do you want to specify catalog folder (Y/N)? N

Open

The newly made ‘teamviewerwindows.intunewin’ is now saved in ‘Desktop’.

Open

Upload to Intune

1, Go to intune https://intune.microsoft.com/?ref=AdminCenter#home and click ‘Apps’, then ‘All apps’, and then search for ‘TeamViewer Host Client’. Click it.

2, Then choose ‘Properties’, and then click ‘Edit’.

3, Then select the file to upload. In this case there is already a file there, but click it all the same.

4, Click the folder icon, choose the newly created file and click ‘open’. Then click ‘OK’.
Click this ‘Review + save’ until you hit the ‘Save’ button.
The files can also be found here, if you need them.

Note: If you do changes in the -bat file, the .intunewin file needs to be created again, and uploaded again.

And you are done grinning face with smiling eyes