Automatic assignment on TeamViewer 13
Hi Everyone,
I'm new to the whole scripting thing and I'm trying to rollout our custom host module with service case features to all of our sites. So far I have got the .bat to run with no errors and when I request help from the module I get the notification and can connect, so it looks like the assignment tool worked. However, when I look in the settings there is nothing in there to show that it is linked to my account meaning that it does not automatically set up unattended access during the install like it should.
I have attached my .bat file if that helps.
Thanks
@echo off
cls
echo.
echo Please Wait While TeamViewer Installs. This Screen will close automatically when finished.
TeamViewer_Host_Setup.exe -idc******** /S
wait
echo
echo Assigning TeamViewer To *************, Please Wait...
if EXIST "C:\Program Files (x86)\TeamViewer\AssignmentData.json"(
TeamViewer_Assignment.exe -apitoken *********-********************* -datafile “C:\Program Files (x86)\TeamViewer\AssignmentData.json”
) ELSE (
TeamViewer_Assignment.exe -apitoken *********-********************* -datafile “C:\Program Files\TeamViewer\AssignmentData.json”
)
Note: I do intend on keeping the IF statement as our sites are not consistent in terms of hardware.
Comments
-
Hopefully you found a solution by now. Throwing this out there in case anyone else finds this page looking for a script
Place the following into a network share:
your MSI or EXE, TeamViewer_Assignment.exe, a copy of PSEXEC, the exported registry file TeamViewer_Settings.reg from your test machine installation, and this script as a .bat file
Custom hosts should be formatted as TeamViewer_Host_Setup-idcxxxxxxx.msi or TeamViewer_Host_Setup-idcxxxxxxx.exe
You will need to remove either the REM MSI or REM EXE and the leading blank space depending which deployment package youre using
Remember to change all strings of xxxxxxxxxxxxx with your custom info for Configuration ID and API Token
If you have users who do not have administrative rights on their machines, you need to precede any start /wait command with psexec -accepteula
@echo off
REM INSTALL TEAMVIEWER
echo Installing TeamViewer, please wait
REM MSI start /wait msiexec.exe /i TeamViewer_Host_Setup-idcxxxxxxx.msi /q
REM EXE start /wait TeamViewer_Host_Setup-idcxxxxxxx.exe /S
REM Import registry
reg.exe IMPORT TeamViewer_Settings.reg
REM Check Windows Architecture
IF NOT EXIST "C:\Program Files\TeamViewer\TeamViewer.exe" GOTO loop64
REM Get 32 Bit Client ID
:loop32
reg query HKLM\Software\TeamViewer /v ClientID
IF "%ERRORLEVEL%" == "0" (GOTO assign32) else (GOTO loop32)
REM Get 64 Bit Client ID
:loop64
reg query HKLM\Software\WOW6432Node\TeamViewer /v ClientID
IF "%ERRORLEVEL%" == "0" (GOTO assign64) else (GOTO loop64)
REM 32 Bit Account Assignment
:assign32
start /wait TeamViewer_Assignment.exe -apitoken xxxxxxxxxxxxxxxxxxxxxxxxxxx -datafile "C:\Program Files\TeamViewer\AssignmentData.json" -allowEasyAccess=false
GOTO reload32
REM 64 Bit Account Assignment
:assign64 start /wait TeamViewer_Assignment.exe -apitoken xxxxxxxxxxxxxxxxxxxxxxxxxxx -datafile "C:\Program Files (x86)\TeamViewer\AssignmentData.json" -allowEasyAccess=false
GOTO reload64
REM Reload 32 bit
:reload32
echo Installation almost complete. Window will close automatically
psexec -accepteula "C:\Program Files\TeamViewer\TeamViewer.exe" --ReloadSettings
waitfor SomethingThatIsNeverHappening /t 10 2>NUL
EXIT
REM Reload 64 bit
:reload64
echo Installation almost complete. Window will close automatically
psexec -accepteula "C:\Program Files (x86)\TeamViewer\TeamViewer.exe" --ReloadSettings
waitfor SomethingThatIsNeverHappening /t 10 2>NUL
EXIT0