We use TeamViewer a lot. It’s been extremely useful, but only when we can connect. Having KACE track the TeamViewer ID numbers will help keep up with changes. TeamViewer Manager is nicely made and easy to use, but it requires manual input and updates.  KACE is a good way to confirm the info in TeamViewer Manager if we run into trouble.

We had a custom inventory rule in KACE that checked the registry and returned the appropriate value. Then we updated the KACE Agent from 5.1 to 5.3 and it stopped working. The information being returned was useless. It wasn’t even readable. I called KACE and we tried several different variations of RegistryValueReturn, but never got it working again.

I came across a post asking about this exact issue and it got me thinking about it again. And I think I have a workaround.

1. Create a .bat file with the following script.

@Echo off

for /f "skip=2 tokens=3" %%A in ('reg query hklm\software\teamviewer\version7 /v clientid') do set /a var=%%A

echo %var%


2. Save the bat file to a network share.

3. Create a Custom Inventory Rule.

ShellCommandTextReturn ("\\Server\Share\TVID.bat")

This bat file only checks 32bit systems, so highlight the appropriate versions of Windows under Supported Operating Systems.

If TeamViewer is installed the rule will return the ID. If it’s not installed you get “ERROR: The system was unable to find the specified registry key or value”. So far it’s working on Windows XP and 7.

Script for 64bit.

@Echo off

for /f "skip=2 tokens=3" %%A in ('reg query hklm\software\wow6432node\teamviewer\version7 /v clientid') do set /a var=%%A

echo %var%