none
limit concurrent remote app session RRS feed

  • Question

  • Hi,

    I have published an Access program using RemoteApp and I would like to limit the remote app to only 1 session.  I would like to limit the remote user to open the app in concurrent remoteapp session.  Is this possible?  Is there a setting that could handle this.

    Any help or guidance out there would be appreciated.

    Tuesday, January 24, 2012 10:59 PM

Answers

  • Hi,

    No, there is not a setting to limit an application to a single instance per remote session.

    Yes, one technique would be to check if msaccess.exe is running and if not start the app.  You need to check only in the current session, for example, your script could use the output of the query process command.  It may be easier to write the functionality within the access application, for example, create a Mutex and check at app startup if the mutex already exists, then exit.

    -TP

    Wednesday, January 25, 2012 6:55 AM
    Moderator
  • Hi TP,

    Thanks for your input.  I got it working using vbscript codes that I have gathered from different sources and combined them in a single script.  I can now open the remote app in 1 instance per user session.

    Regards,

    var-it

    Wednesday, January 25, 2012 10:43 PM

All replies

  • Hi,

    There is no built-in feature to limit the number of concurrent instances of an application that may run.  You may do this by writing a small program/script that you use to launch the application instead of starting it directly.  There are also third-party software packages that will perform this function, however, they may be overkill in your case.

    Are you trying to limit the application to a single instance server-wide, or a single instance per session, or what?

    -TP

    Tuesday, January 24, 2012 11:38 PM
    Moderator
  • Hi TP,

    Thanks for your reply.

    I want to limit the application to a single instance per remote session.  Is there a setting for this?

    I suppose, if I use a script then i should check if msaccess.exe is running then start the application if it isn't.  Is this what you have in mind?

    Regards,

    varit

    Wednesday, January 25, 2012 12:09 AM
  • Hi,

    No, there is not a setting to limit an application to a single instance per remote session.

    Yes, one technique would be to check if msaccess.exe is running and if not start the app.  You need to check only in the current session, for example, your script could use the output of the query process command.  It may be easier to write the functionality within the access application, for example, create a Mutex and check at app startup if the mutex already exists, then exit.

    -TP

    Wednesday, January 25, 2012 6:55 AM
    Moderator
  • Hi,

    thanks for your suggested solution.  I created a vbscript to check if msaccess.exe application is running and it works for 1 user account rdp session.

    The problem I have now is the application will not start if I use another rpd session using another user account in another pc because msaccess.exe is already running and used by the 1st user. 

    What I am thinking now is to compare the username of the process to the username of the 2nd user and if it's different then start the application.  I am trying to look for a code for this but do you think this is a good idea.

    Wednesday, January 25, 2012 7:59 PM
  • Hi TP,

    Thanks for your input.  I got it working using vbscript codes that I have gathered from different sources and combined them in a single script.  I can now open the remote app in 1 instance per user session.

    Regards,

    var-it

    Wednesday, January 25, 2012 10:43 PM
  • Hi var-it,

    Can you share that script? Working on same problem here ...

    Monday, March 5, 2012 2:59 PM
  • Hi Vladislav,

    Sorry for the late reply.  In case you are still interested in the code here it is.  Let me know if it works for you or to any one out there who tried it.

    Dim AllProcess 
    Dim Process 
    Dim strFoundProcess
    dim strCurrentUser
    dim strProcess
    dim strOwner
    
    strProcess="'MSACCESS.EXE'"
    strFoundProcess = False 
    
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    strCurrentUser=WshNetwork.Username
    
    
    
    Set objWMIService = GetObject("winmgmts:")
    Set colProcessbyName = objWMIService.ExecQuery("Select * from Win32_Process Where Name = " & strProcess)
    
    For Each objProcess in colProcessbyName
    colProperties = objProcess.GetOwner(strUsername,strUserDomain)
    
    
    if strUsername = strCurrentUser then 
    msgbox "Current owner - " & strUsername & " is already using the application!"
    strFoundProcess = True 
    Exit for 
    End If 
    
    Next 
    
    
    If strFoundProcess = False Then 
    shell "msaccess.exe c:\piper\piper_app.accdr"
    End If
    Set AllProcess = nothing
    
    
    Sub shell(cmd)
    dim objShell
    Set objShell = WScript.CreateObject( "WScript.Shell" )
    objShell.Run(cmd)
    Set objShell = Nothing
    end sub


    • Edited by jermacnz Wednesday, May 2, 2012 1:46 AM
    • Proposed as answer by arvindrajan92 Friday, January 4, 2013 8:23 AM
    Wednesday, May 2, 2012 1:45 AM
  • hi, could u tell me how to use the vb code please?

    i have the same problem but dont know how to execute the code

    thanks


    Arvind Rajan

    Friday, January 4, 2013 7:39 AM
  • Hi Arvind,

    I am using Remote App and I execute the code in the Remote app programs.  When the user logs in using Remote app the vbscript is executed.

    Regards

    Jerome

    Sunday, January 6, 2013 8:29 PM
  • hi, could u please share it with me? thanks

    Arvind Rajan

    Friday, February 8, 2013 3:32 AM
  • ok, so i have the vbscript now and how does the script automatically executes when the user opens the remoteapp?

    thanks


    Arvind Rajan

    Friday, February 8, 2013 3:44 AM
  • hi arvind create a remote app and call the vbscript. you need remote app services installed in your server. use the remote app manager. regards jerome
    Friday, February 8, 2013 11:25 PM
  • hi arvind after you have created the remote app. you could make an rdp file in the remote app manager. you can distribute the rdp file to the users or they could use the remote web but you have to publish the rdp web in the server and give the URL to the user. I hope this helps. jerome
    Friday, February 8, 2013 11:30 PM
  • ok this is how i publish the remote app. i have an app in my server, so i go to the server manager to publish a remote app. so i click to publish a new remote app and click on the app i wanna publish as a remote app. once, i select the apps, i click publish and it publishes. are my steps right? i suppose they are. so now i also have the vbscript. so now the vbscript has to be called every time the remote app is clicked right? could u explain a little more?

    Thanks and sorry for the trouble


    Arvind Rajan

    Wednesday, February 13, 2013 8:03 AM
  • Hi Arvind

    You could open the 'RemoteApp Manager' via Server Manager >> Roles or from Programs>>Administrative tools>>Remote Desktop Services

    In "RemoteApp Manager', click 'Add RemoteApp Programs' and follow the wizard instructions.  Select or browse the vbscript you created.  When you are done, the program will be displayed in the RemoteApp Programs list.  You can change the Program name and the alias by going to the Properties.  Giving the program an alias and name will be useful when you create RDP as it will display the name when the user opens the RDP file.

    To create the RDP file, click the 'Create .rdp File' and follow the wizard instructions.  You can send the RDP file to your users.

    If you prefer the RD Web, you have to give the server URL to the user so they can use the internet browser. BTW, RD Web works on IE only (I think).

    I'm assuming that your server has 'Remote Desktop Services' and your users are member of the 'Remote Desktop users'.

    Hope this helps.



    Thursday, February 14, 2013 8:04 PM