Worklet for Teamviewer Host?

  • 20 May 2020
  • 8 replies
  • 459 views

Hi all,


I’m currently trying to create a Worklet for TeamViewer Host to silently install on new builds.


I have created an .msi file to attach to the Worklet but currently I don’t know how to bypass the installation so that it actually installs.


Ideally, we would be able to silently install and grant easy access to our admin account (which is already associated within the msi install)

I was wondering if anyone else has tried creating this Worklet or has any insight.


8 replies

Userlevel 7

Looks like /S is the silent install flag, per this post:



Have you tried that flag yet? Also you can use a required software policy to install software, instead of a worklet.

Any update to this inquiry? I am also trying to perform the same task as linhm21.

Here’s the command that will  perform your Host customizations with silent install and grant easy access.


Do this through Required Software and not Worklet. 

Put in a File Name

Put in version 1.0 (or any number, the packlet will update it)

Upload your Host .msi file

Command with your own CustomConfigID and APItoken:

exit (Start-Process -FilePath 'msiexec.exe' -ArgumentList ('/qn', '/i', '"TeamViewer_Host.msi"', 'CUSTOMCONFIGID=1234567', 'APITOKEN=12345678-abcdefghijklmnopqrs', 'ASSIGNMENTOPTIONS="--grant-easy-access"') -Wait -Passthru).ExitCode

Userlevel 1
Badge

Good Afternoon All, So I am looking for help on this;

exit (Start-Process -FilePath 'msiexec.exe' -ArgumentList ('/qn', '/i', '"TeamViewer_Host.msi"', 'CUSTOMCONFIGID=1234567', 'APITOKEN=12345678-abcdefghijklmnopqrs', 'ASSIGNMENTOPTIONS="--grant-easy-access"') -Wait -Passthru).ExitCode

This is the script.
I did update a payload for this script. 

So I have modified the error to not reflect the API/ConfigID.
 

At C:\Program Files (x86)\Automox\execDir545887711\execcmd848948658.ps1:43 char:206
+ ...  'ASSIGNMENTOPTIONS="--grant-easy-access"') -Wait -Passthru).ExitCode
+                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The string is missing the terminator: '.
At C:\Program Files (x86)\Automox\execDir545887711\execcmd848948658.ps1:43 char:125
+ ... =6fxidgj , 'APITOKEN=19229519-4gecmEY0mmcUAsBKD7UL', 'ASSIGNMENTOPTIO ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'APITOKEN=12345678-abcdefghijklmnopqrs', 'ASSIGNMENTOPTIONS="--grant-easy-access"') -Wait 
-Passthru).ExitCode
Write-Output "Installation Completed."
Exit' in expression or statement.
At C:\Program Files (x86)\Automox\execDir545887711\execcmd848948658.ps1:43 char:125
+ ... ', '/i', '"TeamViewer_Host.msi"', 'CUSTOMCONFIGID=1234567 , 'APITOKEN ...
+                                                                  ~
Missing closing ')' in expression.
At C:\Program Files (x86)\Automox\execDir545887711\execcmd848948658.ps1:47 char:5
+ Exit
+     ~
Missing closing ')' in expression.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

COMMAND TIMED OUT.

Are you doing this under worklet or required software?

Did you modify your TeamViewer with custom configs - company name, brand, colors, etc.?

  • Make sure to do it under required software. 
  • If you aren’t doing custom configs, simply erase everything you have and reupload the .msi file. AX will write the install script for you. 
  • If you are doing custom configs, did you change out the strings after “CUSTOMCONFIGID=”  and “APITOKEN=” It should have your company information on their. The TV documentation tells you how to find each. 

The TeamViewer documentation has a lot of info on the installation script that may help you. 

Userlevel 1
Badge

So Looks like I got it working; i was missing a ‘ ; once added solved the issue. 

Badge

You can also add a check at the beginning of the required software worklet so that it only installs when necessary.  Without such a check we saw a lot of ‘failed’ warnings in the Automox reports because it was already installed.  With the check in place it still says it installed but it looks better than failed when an auditor is looking.  Here’s my required software for Teamviewer 32 bit:

 

$checkexist = Test-Path 'C:\Program Files (x86)\TeamViewer\teamviewer.exe' -PathType Leaf
if ($checkexist -eq $true)
{
Write-Output "TeamViewer already installed"
}
if ($checkexist -eq $false)
{
Write-Output "Installed TeamViewer"
Start-Process -FilePath 'msiexec.exe' -ArgumentList ('/qn', '/i', '"TeamViewer_Host.msi"', 'CUSTOMCONFIGID=youridhere', 'APITOKEN=yourtokenhere', 'ASSIGNMENTOPTIONS="--grant-easy-access"') -Wait -Passthru
}

 

You can also include a checkbox at the start of the required software worklet to ensure that it only installs when necessary. We saw a lot of 'failed' warnings in the Automox reports without such a check because it was already installed. When the check is in place, it still says installed, but it looks better than failed to an auditor. Here is the software I need for Teamviewer 32 bit:

Reply