Run initial program specified by user profile and Remote Desktop Connection or client

Run a specific program for a user when log on

Archived Forums

>

Remote Desktop Services (Terminal Services)

  • Question

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    0

    Sign in to vote

    We would like to let our users to run different specific application programs when they log in, e.g. User A will run Program A when log in, and User B will Run Program B when log in, etc.

    I tried to follow Microsoft write-up in the following link to accomplish our objectives stated above:

    http://technet.microsoft.com/en-us/library/cc754110.aspx

    According to the above write-up for Window 2008 R2, it is possible to do the following: "Specify the program that opens whenever the user connects to an RD Session Host server. The program specified is the only program that can be used by the user in the Remote Desktop Services session. When the user closes the program, the connection to the RD Session Host server closes."

    I tried to test this function. I tried to start the Notepad.exe by specifying C:\Windows\System32\Notepad.exe in the User Account Environment Tab. Unfortunately, I can not make it happen. I am not sure what I did wrong.

    It was suggested to me in another Microsoft forum to post this question in the RDP forum. In addition to what I tried above, I also tried to use GPO to accomplish my objectives, but was not successful. Below is what I did:

    1. I created an OU, called "My Users", as follows: ADDS=>ACtive Dreictory Users and Computers => Mydomain.com =>" My Users".

    2. I created a gpo in the OU, "My Users", called "User Group-1".

    3. I created an OU, called "Users", as follows: ADDS=>ACtive Dreictory Users and Computers => Mydomain.com => "Users" .

    4. In the OU, "Users", I created a user account, called "First User".

    5. For Properties of "First User", I made the following settings.

    Tab = Member of: "Domain Users", "Remote Desktop Users", GPO = "User Group-1", and and OU = "Users"

    Tab = Environment: Start the following Program at longon, "c:\windows\system32\notepad.exe"

    6. Using Group Policy Management Editor Console, I made the following setting for policy of GPO="User Group-1"

    User Configuration => Policies => Administration Template => Systems => Run Specified Programs during log on => "c:\windows\system32\notepad.exe"

    User Configuration => Policies => Administration Template => Systems => Log on => Run these programs during logon => "c:\windows\system32\notepad.exe"

    User configuration => Window Components => Terminal Services => Terminal Server => Remote Session Environments => Start a program on connection => Program path and file name => "c:\windows\system32\notepad.exe"

    Unfortunately, I could not start notepad.exe during a user log on. Any help on what I did wrong or what I should do will be much appreciated. Since I am not familiar with scripting, please suggest a solution without using scripting if possible.

    Thanks for your help.

    Monday, June 25, 2012 2:19 PM

Answers

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    1

    Sign in to vote

    Hi,

    1. Please make sure the Remote Desktop Session Host Role Service is installed on the server.

    2. In RD Session Host Configuration (tsconfig.msc), double-click on RDP-Tcp. On the Environment tab, please make sure that Run initial program specified by user profile and Remote Desktop Connection or client is selected.

    3. Please test one method only at a time. I suggest you start with using the Environment tab in the Properties of the user account. For example, test with Notepad first by entering c:\windows\system32\notepad.exe in the Program file name box.

    4. After making the above changes, please log on to the server using Remote Desktop with the test user account. Notepad should open automatically. Close Notepad and the session should log off automatically.

    Please reply back here with your results, whether positive or negative.

    Thanks.

    -TP

    • Marked as answer by Clarence Zhang Tuesday, July 10, 2012 7:33 AM

    Monday, June 25, 2012 2:50 PM

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    1

    Sign in to vote

    Hi David,

    You are running Server 2008 (non-R2). I mistakenly thought you were running 2008 R2 because you mentioned the write-up. In your version the Role is named Terminal Services (Remote Desktop Services in R2) and the Role Service is named Terminal Server (Remote Desktop Session Host in R2).

    It is preferred to have Terminal Server andActive Directoryon separate servers, however, it is not uncommon in small environments/special cases to have them run on a the same server. It is fine to have the TS Licensing Role Service installed on a DC regardless.

    -TP

    • Marked as answer by Clarence Zhang Tuesday, July 10, 2012 7:33 AM

    Wednesday, June 27, 2012 8:45 AM

All replies

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    1

    Sign in to vote

    Hi,

    1. Please make sure the Remote Desktop Session Host Role Service is installed on the server.

    2. In RD Session Host Configuration (tsconfig.msc), double-click on RDP-Tcp. On the Environment tab, please make sure that Run initial program specified by user profile and Remote Desktop Connection or client is selected.

    3. Please test one method only at a time. I suggest you start with using the Environment tab in the Properties of the user account. For example, test with Notepad first by entering c:\windows\system32\notepad.exe in the Program file name box.

    4. After making the above changes, please log on to the server using Remote Desktop with the test user account. Notepad should open automatically. Close Notepad and the session should log off automatically.

    Please reply back here with your results, whether positive or negative.

    Thanks.

    -TP

    • Marked as answer by Clarence Zhang Tuesday, July 10, 2012 7:33 AM

    Monday, June 25, 2012 2:50 PM

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    0

    Sign in to vote

    Thanks for your suggestion.

    I tried to install Remote Desktop Session Host Role Service; however, I can not find this service. There is a Terminal Seiivce Role => Terminal Server role. I am not sure whether "Remote Desktop Session Host Role Service" is the same as "Terminal Service Role".

    Also when I tried to install Terminal Server role, I got a warning sign stating that it is not recommended to install this role. The warning message is "Installing Terminal Server with ADDS is not recommended because allowing users to run programs on a domain controller can increase security risks and degrade server performance" Shall I install Terminal Server role at any rate ,and also install "TS licensing" role.

    In a number of articles, there are instructions as follows:

    These Group Policy settings are located in the following locations:

    • Computer Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Remote Session Environment
    • User Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Remote Session Environment

    However, I can not find User Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Remote Session Environment; instead I used " User configuration => Window Components => Terminal Services => Terminal Server => Remote Session Environments " . I am wondering whether "User Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Remote Session Environment" is the same as " User configuration => Window Components =>Terminal Services => Terminal Server => Remote Session Environments".

    Thanks for your help.

    D.C.

    D.C.

    Monday, June 25, 2012 6:57 PM

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    0

    Sign in to vote

    With that method, you can only run one program at a time, I think it's better that you try a 3rd party program that simulates to Publish application as Citrix. There are some very good paid programs. However I have a freeware program Remote Application Center, that program allows to publish application on Terminal Server and assigned run permission for users. When connecting from the client side, it will use the standard MS Remote Desktop Connection but it will pass the Application Name to the server, so the server side will know which application that we want to run, it then launches that only application, and not the whole desktop. With the standard RemoteApp,user still can access to the whole desktop of TS, that's not a good way to do.

    I have just released a new version 5.0 of Remote Application Center today, it's more compatible with both 32-bit and 64-bit Windows than all previous versions, and it uses the standard MSTSC.EXE toconnect to the server.You could try it out to see if it works for you. You can download it on my website at : http://www.mqtechnologies.com

    Regards

    Thomas Tran


    • Edited by MQTechnologies Tuesday, June 26, 2012 6:17 PM

    Tuesday, June 26, 2012 6:14 PM

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    0

    Sign in to vote

    Terminal Service Role is in

    * Windows 2003

    * Windows 2008

    Remote Desktop Services Role is in

    * Windows 2008 R2

    * Future versions of Windows Server

    Tuesday, June 26, 2012 10:55 PM

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    1

    Sign in to vote

    Hi David,

    You are running Server 2008 (non-R2). I mistakenly thought you were running 2008 R2 because you mentioned the write-up. In your version the Role is named Terminal Services (Remote Desktop Services in R2) and the Role Service is named Terminal Server (Remote Desktop Session Host in R2).

    It is preferred to have Terminal Server andActive Directoryon separate servers, however, it is not uncommon in small environments/special cases to have them run on a the same server. It is fine to have the TS Licensing Role Service installed on a DC regardless.

    -TP

    • Marked as answer by Clarence Zhang Tuesday, July 10, 2012 7:33 AM

    Wednesday, June 27, 2012 8:45 AM

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    0

    Sign in to vote

    TP,

    Thanks for the clarifications. You are right that I have Window 2008, not 2008 R2. I will be checking out your suggestions and let you know.

    Thanks also to Thomas Tran and Geekman for your help and comments.

    DC

    Thursday, June 28, 2012 11:11 PM

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    0

    Sign in to vote

    Apologize for taking so long to come back to you all. Well, I finally succeeded in running an application program when a user logs in and when the program closes the user logs out automatically.

    I followed TP's instructions. What I did is described below:

    1. I found out that my Terminal Services Role was not installed, so I installed it. Server Manager => Click on Roles => Click on Add Roles => Select Terminal Services and Click Next.

    2. I did not install TS Licensing, as I am using a VPS account and it allows two RDP's. I will install TS Licensing when I would like to have more RDP's.

    3. The key thing to make this work is to open Terminal Services Configuration (tsconfig.msc), and double click on RDP-TCP. On the Environment tab, select "Run initial program specified by user profile and Remote Desktop Connection or client". It does seem like a strange place to make this selection.

    4. Everything worked find. By mistake, I did not select ""Run initial program specified by user profile and Remote Desktop Connection or client" on the Environment tab, instead I selected the first choice. As a result, I was locked out as an administrator and could not do anything further. I had to reinstall the Window 2008 server.

    Many, many thanks to TP. I have read many postings on the web and received many suggestions, and I could not make it work. TP's suggestions were very specific and correct.

    Unfortunately, not all my problems in running my Window XP applications with Window 2008 Standard edition were solved. I will post a new question, titled " Running Window XP application program with Window 2008 Standard Edition".

    Saturday, July 21, 2012 4:58 PM

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    0

    Sign in to vote

    If I remember well, when installing RDS you have to install TS Licensing Service, if not it will be expired (stop working)in 120 days.

    Can someone confirm that please.

    Regards

    Thomas Tran

    ============================

    Free utilities for Terminal Server& Citrix

    http://www.mqtechnologies.com

    Monday, July 23, 2012 3:19 PM

  • Run initial program specified by user profile and Remote Desktop Connection or client

    Run initial program specified by user profile and Remote Desktop Connection or client

    0

    Sign in to vote

    I do not think this (120 days) applies to my situation, as my vps allows two simultaneous rdp without purchasing TS Licensing.

    DC

    Monday, July 30, 2012 4:10 PM

Additional Resources

NOTE : For newer versions of OS, refer https://support.citrix.com/article/CTX218256
You might receive the following error messages:

Run initial program specified by user profile and Remote Desktop Connection or client


Run initial program specified by user profile and Remote Desktop Connection or client


To resolve this error, complete the following steps:
  • Presentation Server 4.5 or XenApp 5 on Windows Server 2003

  • XenApp 6.x on Windows Server 2008 R2

Presentation Server 4.5 or XenApp 5 on Windows Server 2003

  1. Click Start > Programs or All Programs > Administrative Tools > Terminal Services Configuration.

  2. Right-click on RDP-Tcp listener in the Connections hive.

  3. Select Properties.

  4. Activate the Citrix Settings tab.

  5. Clear the Non-Administrators only launch published applications option.

Run initial program specified by user profile and Remote Desktop Connection or client

XenApp 6.x on Windows Server 2008 R2

  1. Open the Citrix AppCenter management console.

  2. Select Policies underthe farm.

  3. Activate the User tab.

  4. Add a new or modify an existing user policy.

Note: You can edit the Unfiltered User Policy to ensure that it is applied for all users to all servers.

  1. In the Edit Policy Window, on the Settings tab, open ICA settings.

  2. Enable the Launching of non-Administrator programs during client connection option.

Run initial program specified by user profile and Remote Desktop Connection or client

  1. Ensure that the policy is filtered properly to the user that is used for the RDP connection.

Note: You can edit the Unfiltered User Policy to ensure that it is applied for all users to all servers.

Start a program on connection

Configures Remote Desktop Services to run a specified program automatically upon connection.

You can use this setting to specify a program to run automatically when a user logs on to a remote computer.

By default, Remote Desktop Services sessions provide access to the full Windows desktop, unless otherwise specified with this setting, by the server administrator, or by the user in configuring the client connection. Enabling this setting overrides the "Start Program" settings set by the server administrator or user. The Start menu and Windows Desktop are not displayed, and when the user exits the program the session is automatically logged off.

To use this setting, in Program path and file name, type the fully qualified path and file name of the executable file to be run when the user logs on. If necessary, in Working Directory, type the fully qualified path to the starting directory for the program. If you leave Working Directory blank, the program runs with its default working directory. If the specified program path, file name, or working directory is not the name of a valid directory, the RD Session Host server connection fails with an error message.

If the status is set to Enabled, Remote Desktop Services sessions automatically run the specified program and use the specified Working Directory (or the program default directory, if Working Directory is not specified) as the working directory for the program.

If the status is set to Disabled or Not Configured, Remote Desktop Services sessions start with the full desktop, unless the server administrator or user specify otherwise. (See "Computer Configuration\Administrative Templates\System\Logon\Run these programs at user logon" setting.)

Note: This setting appears in both Computer Configuration and User Configuration. If both settings are configured, the Computer Configuration setting overrides.

Supported on: At least Windows Server 2003


RegistryHiveHKEY_CURRENT_USER
RegistryPathSOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
ValueNamefInheritInitialProgram
ValueTypeREG_DWORD
EnabledValue1
DisabledValue0


Program path and file name

Run initial program specified by user profile and Remote Desktop Connection or client

RegistryHiveHKEY_CURRENT_USER
RegistryPathSOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
ValueNameInitialProgram
ValueTypeREG_SZ
Default Value

Working Directory

Run initial program specified by user profile and Remote Desktop Connection or client

RegistryHiveHKEY_CURRENT_USER
RegistryPathSOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
ValueNameWorkDirectory
ValueTypeREG_SZ
Default Value


terminalserver.admx

2 Replies

· · ·

Run initial program specified by user profile and Remote Desktop Connection or client

Datil

OP

Best Answer

gb5102 Oct 27, 2015 at 02:27 UTC

Here are a few places you can look:

Check this setting in the mstsc.exe client on the user's PC

Run initial program specified by user profile and Remote Desktop Connection or client

Also have a look here in their Account properties in AD

Run initial program specified by user profile and Remote Desktop Connection or client



And finally have a look here in the Remote Desktop Session Host Configuration properties on your RD server

Run initial program specified by user profile and Remote Desktop Connection or client

0

· · ·

Run initial program specified by user profile and Remote Desktop Connection or client

Pimiento

OP

savant2020 Oct 27, 2015 at 19:22 UTC

gb5102, I appreciate the response! There was not a program listed under "Start the following program when the user logs on" in the Environment tab of Remote Desktop Session Host Configuration.However, changing that to "Do not allow an initial program to be launched" resolved the issue. Thanks again for pointing me in the right direction.

0

This topic has been locked by an administrator and is no longer open for commenting.

To continue this discussion, please ask a new question.