Create published applications XenApp to each server
For testing purposes it can be helpful to have a published application without loadbalancing to every single server of your Citrix Farm. The creation of such application can be easily done with the following example script which create a CMD on every farm server:
Add-PSSnapin Citrix.XenApp.Commands -ErrorAction SilentlyContinue $serverlist = Get-XAServer #Get all server from farm #Mainprogram # loop through all servers foreach($srv in $serverlist) { echo $srv.ServerName New-XAApplication -BrowserName "cmd on $srv" -ApplicationType "ServerInstalled" -DisplayName "cmd on $srv" -FolderPath "Applications/Published Apps/z_admin" -ClientFolder "Administration\cmd" -Enabled $true -CommandLineExecutable "C:\Windows\system32\cmd.exe" -WorkingDirectory "C:\Windows\system32" -AnonymousConnectionsAllowed $false -AddToClientStartMenu $false -InstanceLimit "-1" #-WindowType "1024×768" -ColorDepth "Colors256" Add-XAApplicationAccount -BrowserName "cmd on $srv" -Accounts "domain\USER1" Add-XAApplicationAccount -BrowserName "cmd on $srv" -Accounts "domain\USER2" Add-XAApplicationServer -BrowserName "cmd on $srv" -ServerNames $srv.ServerName }
By the way … if you made a mistake you can remove the created applications by the same foreach-loop with Remove-XAApplication:
$serverlist = Get-XAServer #Get all server from farm #Mainprogram # loop through all servers foreach($srv in $serverlist) { echo $srv.ServerName Remove-XAApplication -BrowserName "cmd on $srv" }
All scripts are provided AS IS without warranty of any kind.
Leave a Reply