How to test third party application connectivity?

vimal11592
Tera Expert

Hi,

I want to provide user to test the connectivity of and third party application.It is like the credential store we used to store and there is one link to test the credential.I want to implement something similar for some third party application.The user will store the URL, username, and password and then test the connection.

Can someone please suggest is there any way to implement this.

Thanks,

Vimal

1 REPLY 1

vab_13
ServiceNow Employee
ServiceNow Employee

OPTION#1


It may be possible with an ActiveX controller to open the command prompt and do the needful.  


ActiveX controllers let you do all sorts of things with javascript in IE only.


Here is an example for javascript that could run shell scripts: javascript - Using a WScript.shell activeX to execute a command line - Stack Overflow.


----------



OPTION#2


PowerShell commands via the MID server ECC Queue.


Agent:   mid.server.MID_Server_Name_Here


Topic:   Command <-- Command means use the Windows cmd.exe interpreter. I haven't been able to use "PowerShell" as the topic.


Name:   powershell telnet ..... ....


Queue:   output


However, there is an easy workaround.   Just like above, preface all PowerShell commands with the word powershell.   So above I put "powershell Set-ADUser ...."


If you want to run "ls" just do "powershell ls"


or "powershell Get-ChildItem"



All this does is tell cmd.exe to run powershell.exe and then the PowerShell command that follows.


----------



OPTION#3


Another way to execute PowerShell directly instead of calling cmd.exe first.   It involves simply embedding the command in the ECC Payload in XML.   I used value="ls -l c:\\" but it can be changed to any command.





  1. // PowerShell directly!  
  2. var ecc = new GlideRecord("ecc_queue");  
  3. ecc.initialize();  
  4. ecc.agent = "mid.server.MID_SERVER_NAME_HERE";  
  5. ecc.topic = "Powershell";  
  6. ecc.name = "Windows - PowerShell";  
  7. ecc.queue = "output";  
  8. ecc.state = "ready";  
  9. ecc.source = "127.0.0.1";  
  10. ecc.payload = '<?xml version="1.0" encoding="UTF-8"?><parameters><parameter name="skip_sensor" value="true"/><parameter name="probe_name" value="Windows - Powershell"/><parameter name="script.ps1" value="ls -l c:\\"/></parameters>';  
  11. ecc.insert();




HTH