Deploying Microsoft's Remote Desktop Client with a "Per User" Installation

Resources and References

Getting Started

I believe you may be overthinking this, but I could be wrong. In the Microsoft Docs article, which I'm sure you've seen because it details the parameters you listed above, the section covering Enterprise Deployment starts out with the following:

To deploy the Remote Desktop client in an enterprise, you can use msiexec to install the MSI file. You can install the client per-device or per-user by running the relevant command from Command Prompt as an administrator.

I put the last part in bold because it seems you're spending a large amount of time and effort trying to get the application to execute as the logged-in user and I'm almost 100% positive that's not required. As a point of reference, Microsoft Teams (for Work or School) supports this same type of deployment method and configuration ─ an .MSI file that can be used to perform either a "Per Device" or "Per User" installation. When "Per User" is specified, the installation of the application happens quite differently as some shared files are copied to a central location but the application is set to launch either the app itself (if already configured) or the installer each time a user logs into the machine. Per-user data is stored in that user's AppData folder. I would imagine this works almost identically.

Secondly, it's worth noting that msiexec doesn't require the .MSI file to be downloaded locally to the machine. You can provide a URL in place of the file path. For example, let's say you wanted to test the theory of running msiexec as an Administrator but specifying that the installation should be "per user." You could run this command as an Administrator:

msiexec /i "https://go.microsoft.com/fwlink/?linkid=2068602" /qn ALLUSERS=2 MSIINSTALLPERUSER=1

Using Microsoft Intune

You said in another comment that you're deploying PSADT with Intune. Assuming the previous step works (installing as an Administrator but providing the per-user arguments) then you can circumnavigate all this extra work you're doing and simply upload the RemoteDesktop_1.2.3770.0_x64.msi to Intune and provide the parameters.

Worst case scenario, you write a PowerShell script that calls the msiexec command above then deploy that PowerShell script through Intune.
Here's a good start on what that PowerShell script may look like for you:

# Define Behavior
$ProgressPreference = 'SilentlyContinue'
$ErrorActionPreference = 'Stop'

# Define Variables/Args/Params
$msiFileName = "https://go.microsoft.com/fwlink/?linkid=2068602"
$argAllUsers = "2"
$argInstallPerUser = "1"

$argumentList = @(
    '/i'
    '"{0}"' -f $msiFileName
    '/qn'
    'ALLUSERS="{0}"' -f $argAllUsers
    'MSIINSTALLPERUSER="{0}"' -f $argInstallPerUser
)

$startArgs = @{
    "FilePath" = "msiexec.exe"
    "ArgumentList" = $argumentList
    "Wait" = $true
}

Start-Process @startArgs

Note: This script was taken and modified from the StackOverflow question listed under Resources/References above.

Edit

Pub: 14 Jan 2023 14:58 UTC

Views: 95