Powershell Script to launch one or more Published Applications from Storefront 2.x and 3

by Stan Czerno September 8, 2015 05:38 CST

Update: I have a newer version of this script: Powershell Script to launch one or more Published Applications from Citrix Storefront 2.x through 3.6

Since Citrix has released version 3 of Storefront, I needed to make an update to my original script, found here, to make it work with the latest Storefront release. I decided to make a few more modifications as well to provide more info.

I added a routine to the script to check for an Alert Box when the application is found but cannot launch. This error is usually caused by the server's logons being disabled.

For example, the error in Storefront 2.x looks like this:

In Storefront 3 it looks like this:

If either of these are encountered, the script will alert you to check the server(s) or the Storefront logs.

I also attempt to see if the Citrix Client error dialog window appears. For example, if you receive the "SSL Error 29 Error Message", the script should see the window and alert you.

I also added a routine to alert if the NetScaler has ran out of licenses. I encountered this in my lab since I only have 5 licenses. The problem was that the previous version of the script did not attempt to logoff when an error was encountered. I moved some of the functions calls to the finally section so if an error was encountered it would attempt a logoff and release the NetScaler license.

Thanks goes to Chris Straight for showing me what I needed to get the script to work with Storefront 3.

The original script can be found at Citrix; Automating the launch of HDX sessions through StoreFront (and NetScaler Gateway integrated with StoreFront).

See my previous post on how to use the script.

SFLauncher3.ps1:

Tags: , , , ,

Catergories: Citrix | Receiver | Storefront | XenApp

Comments (8) -

Florian Kirchner
November 8, 2015 23:40 CST

You should replace following line
$alertboxlink=$internetExplorer.Document.getElementsByTagName("a") | where-object {$_.className -eq "dialog button default" }
with
$alertboxlink=[System.__ComObject].InvokeMember(“getElementsByTagName”,[System.Reflection.BindingFlags]::InvokeMethod, $null, $internetExplorer.Document, "a") | where-object {$_.className -eq "dialog button default" }

Stan Czerno
November 16, 2015 04:16 CST

I made the change as well as fix a minor problem with checking for Alert Boxes. If the script does not refresh the page, the Alert Box still exists in the source code of the page.

Brian McGee
November 23, 2015 04:25 CST

Great script.  My only issue is that the security banner hangs the logon process.  I see in the code it looks for the Receiver window to send an "enter" but this does not occur.  If I manually hit "ok" on the login banner, it works perfectly.  Any suggestions?

Stan Czerno
November 23, 2015 04:33 CST

There are plenty on examples of how it was achieved in the script, you'll just need to find the right element and create a function to click on the button.

Brian McGee
November 23, 2015 08:34 CST

The tricky thing appears to be identifying the remoted "Windows Logon" window.  The title is slightly different every time (RedirectWindow_Wnd:#####:wfcrun32.exe.  I don't see a way to use wildcards with FindWindow.

Stan Czerno
November 23, 2015 08:51 CST

My bad, I thought you were referring to a NetScaler/Storefront security banner. You will not be able to automate that as that Window/Dialog is in the ICA/HDX (remote) Session.

Brian
December 30, 2015 07:16 CST

Is there a download for it (SFLauncher3.ps1), the text contains unwanted characters �.

Stan Czerno
December 30, 2015 07:28 CST

They were quotes, I fixed the text file.

I am also working on an updated version as we speak. I was able to get the Windows Logon banner to close for Brian McGee.

Comments are closed