Due to the fact that I have 2 remote apps, I can't just edit the environmen tab to run the application as this will only lauch one applications.
I got a friend to look into this, and what he did...
tested on one user.
in the environment tab enter logoff.exe
when a user logs on remotely he will automatically be logged off. and doesn't affect remoteapps.
get-qaduser "user name" | set-qaduser -TsInitialProgram "%systemroot%\system32\logoff.exe"
because I only wanted to stop remote user from launching the desktop (all my remote users in Acitve directory had a description for what city they were from)
3. Use powershell script to set the user's AD attribute 'Starting program' under the Environment tab from AD Users and Computers. The remote users are the ones with description attributes filled in its AD account.
--- powershell script to set the user's property ---
$users = "user name1", "user name2", "user etc
foreach ( $user in $users) {
$userObj = get-qaduser $user
# Checks to see if the user's description account is filled.
# Set the 'Starting program' attribute if it is, otherwise skip.
#
if ( $userObj.description -ne $null ) {
$str = $userObj.name + ": [" + $userObj.description + "]"
$userObj | set-qaduser -TsInitialProgram "%systemroot%\system32\logoff.exe"
} else {
write-host "$($userObj.name) is a local user."
}
}
--- verification code to make sure that the attribute has been set ---
foreach ($user in $users ) { $userObj = get-qaduser $user
if ( $userObj.tsInitialProgram -ne $null ) {
write-host "$($userObj.name) ($($userObj.description)): $($userObj.TsInitialProgram)"
} else {
write-host "$($userObj.name) is a local user"
}
}
yields result below.
user name is a local user
username (city Office (Office Administrator)): %systemroot%\system32\logoff.exe
works great, if anyone else knows a better solution please share.
http://ms-os.com/windows-nt-server/188658-remoteapp-vs-full-remote-desktop.html