Windows Server 2012 - TSE - RemoteApp - Configure Windows 7 clients and later by GPO

Page 1 / 1
  • Published on : 07 April 2017 at 19:08 UTC
  • By Lionel Eppe

When you deploy Remote Desktop Services to use the RemoteApp technology, you must then specify the address of your RemoteApp server on the various client PCs.

Although this is possible manually, it's also possible to do this with 2 group policies (GPO), as well as a PowerShell script (for Windows 7 only).
With these 2 group policies, you will be able to configure the access to RemoteApp applications for client PCs under Windows 7 or later.

Info : to use the RemoteApp technology on Windows Server 2012, check one of our tutorials :

  1. Configuring group policies (GPO)
    1. GPO for Windows 7
    2. GPO for Windows 8 and later
    3. Applying new group policies
  2. Test of the configuration under Windows 7
  3. Test of the configuration under Windows 8
  4. Test of the configuration under Windows 10

1. Configuration des stratégies de groupes (GPO)

To get started, go to your Active Directory server and run the program : Group Policy Management.
Then, right-click the "Default Domain Policy" item and click "Edit".

1.1. GPO for Windows 7

To automatically configure the access to RemoteApp resources from Windows 7 clients, you will need :

Contents of the file : Install-RADCConnection.ps1

Code : PowerShell

<# 
.SYNOPSIS 
    Installs a connection in RemoteApp and Desktop Connections. 
.DESCRIPTION 
    This script uses a RemoteApp and Desktop Connections bootstrap file(a .wcx file) to set up a connection in Windows 7 workstation. No user interaction is required.It sets up a connection only for the current user. Always run the script in the user's session. 
 
The necessary credentials must be available either as domain credentials or as cached credentials on the local machine. (You can use Cmdkey.exe to cache the credentials.) 
 
Error status information is saved in event log: (Applications and Services\Microsoft\Windows\RemoteApp and Desktop Connections). 
 
.Parameter WCXPath 
    Specifies the path to the .wcx file 
     
.Example 
     
PS C:\> Install-RADCConnection.ps1 c:\test1\work_apps.wcx 
 
Installs the connection in RemoteApp and Desktop Connections using information 
in the specified .wcx file. 
     
#> 
Param( 
    [parameter(Mandatory=$true,Position=0)] 
    [string] 
    $WCXPath 
) 
 
 
function CheckForConnection 
{ 
    Param ( 
        [parameter(Mandatory=$true,Position=0)] 
        [string] 
        $URL 
    ) 
 
    [string] $connectionKey = "" 
    [bool] $found = $false 
 
    foreach ($connectionKey in get-item 'HKCU:\Software\Microsoft\Workspaces\Feeds\*' 2> $null)  
    { 
        
        if ( ($connectionKey | Get-ItemProperty -Name URL).URL -eq $URL) 
        { 
            $found = $true 
            break 
        } 
    } 
 
    return $found 
} 
 
 
# Process the bootstrap file 
[string] $wcxExpanded = [System.Environment]::ExpandEnvironmentVariables($WCXPath)  
[object[]] $wcxPathResults = @(Get-Item $wcxExpanded 2> $null) 
 
if ($wcxPathResults.Count -eq 0) 
{ 
    Write-Host @" 
 
The .wcx file could not be found. 
 
"@ 
 
    exit(1) 
} 
 
if ($wcxPathResults.Count -gt 1) 
{ 
    Write-Host @" 
 
Please specify a single .wcx file. 
 
"@ 
 
    exit(1) 
} 
 
[string] $wcxFile = $wcxPathResults[0].FullName 
[xml] $wcxXml = [string]::Join("", (Get-Content -LiteralPath $wcxFile))  
[string] $connectionUrl = $wcxXml.workspace.defaultFeed.url 
 
if (-not $connectionUrl) 
{ 
    Write-Host @" 
 
The .wcx file is not valid. 
 
"@ 
 
    exit(1) 
} 
 
if ((CheckForConnection $connectionUrl)) 
{ 
    Write-Host @" 
 
The connection in RemoteApp and Desktop Connections already exists. 
 
"@ 
 
    exit(1) 
} 
 
Start-Process -FilePath rundll32.exe -ArgumentList 'tsworkspace,WorkspaceSilentSetup',$wcxFile -NoNewWindow -Wait 
 
# check for the Connection in the registry 
if ((CheckForConnection $connectionUrl)) 
{ 
    Write-Host @" 
 
Connection setup succeeded. 
 
"@ 
} 
else 
{ 
    Write-Host @" 
 
Connection setup failed. 
 
Consult the event log for failure information: 
(Applications and Services\Microsoft\Windows\RemoteApp and Desktop Connections). 
 
"@ 
     
    exit(1) 
} 

Contents of the file : feed.wcx

Note : don't forget to change the "server-tse.informatiweb.lan" value of the code below by the name of your RemoteApp server (or by the name of the broker if you use multiple servers for RemoteApp).

Code : XML

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<workspace name="Workspace Resources" xmlns="http://schemas.microsoft.com/ts/2008/09/tswcx" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <defaultFeed url="https://server-tse.informatiweb.lan/RDWeb/Feed/webfeed.aspx" />
</workspace>

Once you have created these 2 files, go to : User Configuration -> Policies -> Windows Settings -> Scripts (Logon/Logoff).
Then, double-click on : Login.

Go to the "PowerShell Scripts" tab and click "Add".

Click : Browse.

By default, you will be in a "Logon" folder.
Copy the Install-RADCConnection.ps1 and feed.wcx files to this folder, and then select the file : Install-RADCConnection.ps1

The script's name appears.
Add "feed.wcx" as the script parameter and click OK.

Now, the RemoteApp configuration on Windows 7 clients will be performed automatically when a user of the Active Directory logs on.

1.2. GPO for Windows 8 and later

For Windows 8, 8.1, and Windows 10, go to : User Configuration -> Policies -> Administrative Templates -> Windows Components -> Remote Desktop Services -> RemoteAppe and Desktop Connections.
Then, double-click on the line : Specify default connection URL.

Choose "Enabled" and specify the URL of your RemoteApp server.
Note : this is the same URL that is in the feed.wcx file used for automatic configuration of Windows 7 clients.
The url is similar to this : https://server-tse.informatiweb.lan/RDWeb/Feed/webfeed.aspx

Now, Windows 8, 8.1, and 10 (and later) clients will automatically be configured when a user of the Active Directory logons.

1.3. Applying new group policies

Run the "gpupdate" program on your Active Directory server, and then disconnect from that server and connect again.
Now, client PCs will automatically have access to RemoteApp applications.

2. Test of the configuration under Windows 7

On one of your Windows 7 client PCs that are linked to your Active Directory, log on with a user of your Active Directory.

Then, go to the Control Panel and select : View by Small icons.

Click on : RemoteApp and Desktop Connections.

Access to desktops and programs of your workspace (RemoteApp) is already configured.

In the Start menu, you will also find shortcuts for RemoteApp applications to which this user of the Active Directory accesses.

3. Test of the configuration under Windows 8

On one of your Windows 8 client PCs linked to your Active Directory, log on with a user of your Active Directory.

You will notice that an additional icon has appeared in the taskbar.
Double click on this icon.

The "RemoteApp and Desktop Connections" window appears.
As you can see, the connection is already configured (using GPO group policies).

In the list of applications, accessible from the Windows 8 home screen, you will also find shortcuts for RemoteApp applications that your user can use.

Of course, if you run one of these RemoteApp applications, it will work properly.

4. Test of the configuration under Windows 10

Using the previously created GPOs, clients running Windows 10 will also be configured automatically.

In the control panel, select the small icon view.

Click on : RemoteApp and Desktop Connections.

Access to RemoteApp applications is well configured.