cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mghabel
Engaged Sweeper II
Hi
I would like to create a custom action for teamviewer. I would like to populate one of the custom fields with teamviewer's ID. Then create a custom action to launch teamviewer and pass the computer ID to it.
Thanks
Max
6 REPLIES 6
brican847
Engaged Sweeper II
I'm getting an error on line 1 char 1. Why would it have trouble with "Call Init"? Has anyone got this to work?
Thierry_Bec
Engaged Sweeper
Hello Alexandre,

i'm french and my english is very poor.
I try to explain my problem.
I have an error at line 13 i think i make a mistake when i wrote my user id and my password on the vbs script ,can you explain exactly where.

thanks a lot.

Thierry

Even
Engaged Sweeper
Hello,

I wrote a simple vbs script to get the field from sql database and then pass it to a custom action to work with teamviewer

needed: teamviewer.vbs , teamviewer.exe

Save teamviewer.exe in the action folder as configured in {actionpath}

Save teamviewer.vbs in the same folder.

teamviewer.vbs


call Init

Public Sub Init

Dim rstAuthors, teamviewerid, shell

if isobject(cn) = false then
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cn.ConnectionString = "Provider=SQLOLEDB.1;Data " & _
"Source=sourcedatabase; Initial Catalog=lansweeperdb;user id = " & _
"'sa';password='yourpassword'"
cn.Open
strAuthorsQry = "Select tblCompCustom.Custom1 From tblComputers Inner Join tblCompCustom On tblComputers.Computername = tblCompCustom.Computername Where (tblcomputers.domain = '" & wscript.arguments(0) & "' AND tblcomputers.computer = '" & wscript.arguments(1) & "')"

set rstAuthors = cn.execute(strAuthorsQry)

rstAuthors.MoveFirst

teamviewerid = rstauthors("Custom1")

Set shell = CreateObject("WScript.Shell")
shell.Run "\\pathtoactionsfolder\teamviewer.exe -i " & teamviewerid & "", 1, false
Set shell = Nothing

end if

End Sub



then create a computer custom action

{actionpath}teamviewer.vbs {domain} {computer}

In this case I used domain and computer but you can use another parameter of your choice.

This worked for me, if you have any question please post and I will help as possible.

Remember to change the details of the connection/query with your environment parameters.

Alexandre.
Hemoco
Lansweeper Alumni
It's not possible to use one of the custom fields in the actions. We've added this to our list of feature requests.

When will this new feature be released?

Obi_1_Cinobi
Lansweeper Tech Support
Lansweeper Tech Support

Hello there!

While this feature is still on our customer wish list, it is not in active development. As such, we aren't able to guarantee that this feature will be implemented or provide you with an estimated release date at this time.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now