Hello,

 

I am able to get the TeamViewer ID of each PC and Mac using a custom field.  But when I try to create the machine action to launch TeamViewer and use that ID, it fails.  I am using a Mac and this is what I am putting in the Machine Action field.

open –a TeamViewer --args –i KACE_CUSTOM_INVENTORY_TEAMVIEWID –P xxxxxxxxxx

 

I keep receiving the error "Invalid URL"

Has anyone done this with a Mac?  I found one post here, http://www.itninja.com/blog/view/k1000-machine-action-s-to-launch-os-x-support-tools

But it seems to have left out a few pieces that I will need to get it to work.  I am new to this.

Thanks

2 Comments   [ + ] Show Comments

Comments

  • Have you attempted using IP_Address instead of TV_ID?
  • Has anyone gotten this to work with a non mac? I've successfully gotten KACE to extract the TeamViewer ID with versions 9 and 11, but am having trouble with the Device Action to work in KACE 6.4
Please log in to comment

Answers

0

Although I don't have the answer to this question, I can provide a little guidance. In fact, I'm trying to get this to work myself, using the same reference link you provided, but haven't gotten it 100% yet. 

You can't use your code in the machine action (now Device Action in v6.0) field. As far as I know, the only supported way to do this is with a URL protocol, using Safari. In other words, you can't pass applescript, shell, bash or any other scripting language into this. In order to get it to work, you would have to create a custom URL handler on your Mac (example: tvlaunch) and call that from the Device Action field (example: tvlaunch://KACE_CUSTOM_INVENTORY_TEAMVIEWERID) 

I am, however, unable to get my custom URL handler to work. So if you can manage to figure that out, please let me know!

Answered 05/15/2014 by: dgretch
Third Degree Blue Belt

  • Hey there,

    I was wondering if you ever had any luck in this? I was the one who created that original post and may be able to assist you a little.

    You are exactly right on your analyses, in fact my original post basically advises to create a new URL protocol.

    However one caveat, I have never been able to get it to be able to pass TeamViewer ID's properly. My example used IP Addresses instead.

    After you create the tvlaunch application with the URL Handler, what is the outcome when you use Safari to browse to tvlaunch://ip.addr.ess?? Does it pull up the Teamviewer program at all?
    • I gave up on this after grinding on it for another day or two. I'm the only sysadmin at my shop using a Mac for my daily work, so it really only affects me. So I resorted to sucking it up and waiting the 2 extra clicks.

      I'm confused a little by your post...were you able to get the URL handler to launch TV from Safari, and so your issue is only in getting the target ID into the app, or are you still not able to get the URL Handler to work?
      • I had the whole thing working just fine. I never used the TV ID as the argument though. I always called it up via IP Address. That is how I wrote the script. So my example I originally posted was always looking for the IP Address and NOT the TV ID.

        Basically with my original post I was able to launch TV from Safari no problem using tvlaunch://ip.addr.ess. Once that worked I just simply made the K1000 action.
    • Oh! Well then...can I ask how you set up your URL handler?
      • Its all defined in the application itself right in the info.plist file of the App. When you create the blank application using applescript and save it as an application, it creates all of the necessary files. Edit the info.plist file and add the URL portion in there.

        Its called the URL SCHEME step one of my original write up.

        Look here for more info: http://www.macosxautomation.com/applescript/linktrigger/
    • There's a connection somewhere I'm not getting. What does your applescript code look like? How do you pass the IP address as a variable to the shell?
      • I can't seem to find a way to easily paste the script this site removes the formatting and puts in its own. Is there an easy way I can just simply attach a rich text file that you know of?
    • Yep! pastebin will be your new best friend: http://pastebin.com/
      • Awesome! That will be my new best friend!!! Ok here is the main code script I did.

        http://pastebin.com/8dpRxph2

        And here is the info.plist file I use
        http://pastebin.com/tuU35V1B
      • Don't forget this is an applescript saved as an application. Also in the main script don't forget to put the actual path of TeamViewer. Mine was in a TeamViewer 8 folder in the applications. I was able to modify it to use TeamViewer 9 as well FYI.
    • AWESOME. This works like a charm for me using the teamviewer ID custom inventory rule I created + my machine action from above. You're not able to pass the ID to the app? What do your custom inventory rule and machine action look like?
      • To be honest its been a while since I tried the TV ID. It may work just fine but IP does as well so I never really bothered too much on the ID.

        So is it working now?
    • Yea it works for me, I appreciate the help a ton. IP isn't feasible for me at all but this works great either way
      • Excellent! I am glad it works now... I am actually surprised how many people have actually found this useful at all. I thought for sure I would be the only one LOL.

        Also thanks for the tip about paste bin!
      • I'd love to hear how you got it to pass your TeamViewer Custom Inventory ID through. I can get it to Launch TeamViewer, but can't get it to pull the ID from my custom field. my code is
        "%ProgramFiles%\\TeamViewer\\TeamViewer.exe" -i MACHINE_CUSTOM_INVENTORY.SOFTWARE_ID=11225 --Password xxxxxxx
Please log in to comment
This content is currently hidden from public view.
Reason: Removed by member request
For more information, visit our FAQ's.

Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share