We just started using teamviewer and wanted to be able to initiate the remote from kace. 

After some searching around I found this link posted by thewuzzles:

http://www.kace.com/support/resources/kb/solutiondetail?sol=SOL111924

Knowledge Article 111924
  • Title:

    Using the KACE_CUSTOM_INVENTORY Machine Action

  • Description:

    In the K1000 server version 5.4.x, a new Machine Action variable was introduced, KACE_CUSTOM_INVENTORY_*. 

    The KACE_CUSTOM_INVENTORY_* field can be used to check a custom inventory value. The * will be replaced with the Display Name of the custom inventory rule. Only allowed characters are [A-Z0-9.-]. Anything else will be replaced with an '_' character.

  • Resolution:

    For these instructions, I have used TeamViewer remote control as the example. 

    1. Follow the regular steps for your Internet Security settings:
      1. http://www.kace.com/support/resources/kb/article/How-to-set-Internet-Explorer-Security-Settings-for-use-with-the-KACE-K1000-Inventory
    2. Install teamviewer on both the source and target system either manually or via the KBOX in a script/Manage Install.
    3. Create a new software inventory item (Inventory > Software > Choose Action > New Item): 
      1. Display Name: TEAMVIEWERID
      2. In the Custom Inventory Rule section, put:
        1. RegistryValueReturn(HKEY_LOCAL_MACHINE\SOFTWARE\TeamViewer\Version7, ClientID, NUMBER)
    4. Force an inventory on your test machine so that the inventory rule can be ran. To verify the rule work, look at the machine inventory under Custom Inventory. You should see something similar below: 
      1. 1) TEAMVIEWERID: 165426868 [string] 
    5. Set machine action as follows: 
      1. "C:\Program Files (x86)\teamviewer\version7\teamviewer.exe" -i KACE_CUSTOM_INVENTORY_TEAMVIEWERID 
      2. OR you could do: "%PROGRAMFILES%\teamviewer\version7\teamviewer.exe" -i KACE_CUSTOM_INVENTORY_TEAMVIEWERID 

    Once those are done, you can use your machine action to connect to a machine with their TeamViewer ID. 

    You can also click the little orange question mark next to the Machine Actions title on General settings. It more details on the custom inventory variable.

Double check your registry location for the ClientID. Mine was found under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\TeamViewer\Version9 So just make sure its pointing to the version you own.

I also found this link that explanes teamviewer command line parameters.

http://www.teamviewer.com/en/help/91-Are-there-parameters-to-start-TeamViewer.aspx

Are there parameters to start TeamViewer?

TeamViewer can be run via command line using different parameters which have to be preceded with a "--" (e.g. --Password 123456). Alternatively you may also use the short form which is executed with a "-" in the beginning (e.g. -P 123456).

Below you can see an example of a command line in which TeamViewer is connecting to a specific ID, using a predefined password and a preset connection mode:

C:\Program Files\TeamViewer\Version8\teamviewer.exe -i 18876347 --Password test -m fileTransfer

The available connection modes are:

  • Remote-Control:
    teamviewer.exe -i <ID> --Password <Password>
  • FileTransfer:
    teamviewer.exe -i <ID> --Password <Password> -m fileTransfer
  • VPN:
    teamviewer.exe -i <ID> --Password <Password> -m vpn

We have a set password on our teamviewer hosts so I added the "--Password" parameter to the machine action. This speeds it up a little in case you get tired of typing passwords over and over. 

If your host is configured to accept lan connections, then you can connect via IP address instead for a better connection. Just replace the KACE_CUSTOM_INVENTORY_TEAMVIEWERID in the machine action with KACE_HOST_IP.

So in the end I ended up creating 2 machine actions. The first one for connecting to the local IP for speed. And a second for connecting to the ID for computers that are outside the lan connection.

Here are my actions:

"C:\Program Files (x86)\TeamViewer\Version9\TeamViewer.exe" -i KACE_HOST_IP --Password <YourStaticPassword>

"C:\Program Files (x86)\TeamViewer\Version9\TeamViewer.exe" -i KACE_CUSTOM_INVENTORY_TEAMVIEWERID --Password <YourStaticPassword>

And of course change the directory location accordingly. 

I hope some of you find this as helpful as I did. Just wanted to try to make it a bit easier for others to find.