21 August 2012

Run as alternate user for XenApp and RDS applications

Generally it is preferred to have pass-through authentication for seamless applications published through Citrix Xenapp and Microsoft's Remote Desktop Services. On occasion you may want to run an application as another user account.
An example of this is to only allow user accounts to interactively log onto your host server, but requiring alternate credential for an application

This script will prompt the user for the username to use - it will combine it with the application path specified (in red) and ultimately request a password.

Copy the script and save it as a runalternate.vbs file. In RDS or Xenapp specify the applications as cscript runalternate.vbs
' #################################################
'
' This Script will use the runas command to execute
' the specified app as the specified username
'
' #################################################
' Specify the application path here - leave thequotation marks as is

apppath = " ""C:\Program Files\Windows Resource Kits\Tools\confdisk.exe"""

Dim Wshshell
Username = InputBox("Enter The admin Account domain\username", "Run App as")
command = "runas /noprofile /user:" & Username & apppath
Set Wshshell = WScript.CreateObject ("WSCript.shell")
Wshshell.run command
Set wshshell = Nothing



No comments:

Post a Comment