PSM. Developing connector. How to run program and batch file at the same time.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

PSM. Developing connector. How to run program and batch file at the same time.

L2 Linker

PSM. Developing connector. How to run program and batch file at the same time.

Hello. I developing connector. This connector must do this: map local drives and map drive from remote system (Windows OS based) to PSM server and open application Explorer++

At final i have: Explorer++.exe and batch file ShareMappper.bat in PSM\Components folder.

Batch file have 3 variables: %1 is {Address}, %2 is {username} and %3 is {Password}, and map folder from remote system and then call Explorer++.exe

In Administration\Configuration Options\Connection Components, I create new compnonent with settings: ClientApp: Explorer++.exe, ClientDispatcher: ShareMappingDispatcher.bat {Address} {Username} {Password}, ClientInvokeType: Dispatcher, Lock Application Window: Yes.

When i click to Connect, session started and i see Explorer++.exe with mapped drives (Both local from my computer and remote system) but I cannot control Explorer.exe with mouse. After several seconds PSM popup message: Session has been closed. PSMSR605E [21212xzcz-1s47-gfch-9a67nxcv878] Error occured while waiting dispatcher to communicate (Error details: [PSMSR606E] [21212xzcz-1s47-gfch-9a67nxcv878] Timeout occured while waiting for a specific components to end]).

I try to increase ConnectionComponentInitTimeout from 20000 to 60000 and decrease to 0, set Lock Application Window to No with no results.

Batch file run succesfull directly from PSM Server.

Who know how to do right?

 

1 accepted solution

Accepted Solutions

L4 Transporter

A dispatcher does more than just start an application. Among others, it attaches the PSM session to your application and allows you to manipulate it. When the attached application is closed, the PSM force closes the session.

 

What I would do in you case: use an AutoIt dispatcher. It will do what a dispatcher is supposed to do and you won't have to whitelist cmd.exe in AppLocker to allow execution of your batch script.

 

Steps:

  1. In the Connection Components, duplicate the PSM-VNCViewer sample. In its Target Settings, specify the name of your AutoIt script (it does not exist yet though)
  2. On PSM under PSM\Components\, duplicate the PSMAutoIt skeleton file and rename it so it matches the CC definition (step1)
  3. Adapt the script to mount the remote system drive using AutoIT functions. You have access to username, address and password through variables $TargetUsername, $TargetAddress and $TargetPassword anywhere in your script (they are defined in global scope). Finally use Run() to launch Explorer++
  4. Allow AutoIt.exe (if not already) and Explorer++.exe in AppLocker config

 

For more detailed instructions, search for "universal connector" in official implementation guide or OnlineHelp.

View solution in original post

2 REPLIES 2

L4 Transporter

A dispatcher does more than just start an application. Among others, it attaches the PSM session to your application and allows you to manipulate it. When the attached application is closed, the PSM force closes the session.

 

What I would do in you case: use an AutoIt dispatcher. It will do what a dispatcher is supposed to do and you won't have to whitelist cmd.exe in AppLocker to allow execution of your batch script.

 

Steps:

  1. In the Connection Components, duplicate the PSM-VNCViewer sample. In its Target Settings, specify the name of your AutoIt script (it does not exist yet though)
  2. On PSM under PSM\Components\, duplicate the PSMAutoIt skeleton file and rename it so it matches the CC definition (step1)
  3. Adapt the script to mount the remote system drive using AutoIT functions. You have access to username, address and password through variables $TargetUsername, $TargetAddress and $TargetPassword anywhere in your script (they are defined in global scope). Finally use Run() to launch Explorer++
  4. Allow AutoIt.exe (if not already) and Explorer++.exe in AppLocker config

 

For more detailed instructions, search for "universal connector" in official implementation guide or OnlineHelp.

L2 Linker

Thank you! I was do disc mapping in dispatcher used "DriveMapAdd" AutoIt function.

  • 1 accepted solution
  • 1039 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!