?
Solved

PowerShell Script for XenApp

Posted on 2011-10-05
12
Medium Priority
?
1,850 Views
Last Modified: 2012-05-12
I have created an .ica file called Notepad.ica. On double-clicking it launches the Notepad published from a particular server.

I am also using the following code to execute that Notepad.ica file.

Invoke-Item D:\Notepad.ica

I need a PowerShell code that will write a log if it unable to launch the Notepad.ica file using PowerShell. Can you please help me on that?

I am using XenApp 5 version.
0
Comment
Question by:hchabria
  • 6
  • 6
12 Comments
 
LVL 37

Expert Comment

by:Carl Webster
ID: 36918001
For testing do this:

invoke-item d:\notepad.ica -ea 0
if( !$? )
{
      $Tmp2 = Get-Date
      $Tmp1 = "OOPS got an error on "
      write-output "$Tmp1 $Tmp2"
      add-content d:\oops.txt "$Tmp1 $Tmp2"
}
0
 

Author Comment

by:hchabria
ID: 36918285
CardWebstar

I disabled the network on a XenApp server from which the Notepad.ica has been published.

I then executed the script you have given. The Notepad is not launching with an error as expected, but the problem is that I am not getting any output in the D:\oops.txt file.

Please help me.
0
 
LVL 37

Expert Comment

by:Carl Webster
ID: 36918306
from the powershell prompt, do the invoke-item line and see what happens.  Does PS return a warning or error?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:hchabria
ID: 36918408
I've commented out the invoke-item line, but no result. PS is not giving any warning or error.

#invoke-item d:\notepad.ica -ea 0
if( !$? )
{
      $Tmp2 = Get-Date
      $Tmp1 = "OOPS got an error on "
      write-output "$Tmp1 $Tmp2"
      add-content d:\oops.txt "$Tmp1 $Tmp2"
}
0
 
LVL 37

Expert Comment

by:Carl Webster
ID: 36918818
Not what I meant.  do the invoke-item line by itself from a powershell prompt.
0
 

Author Comment

by:hchabria
ID: 36918995
Sorry for the confusion.

I executed invoke-item from a powershell prompt. The Notepad application is launching properly.

I then put the XenApp server out of network. Now t's giving the following error:

"Cannot connect to the Citrix Presentation Server. The Citrix Presentation Servers are reporting full load and cannot accept your connection at this time. Try to connect again after a few minutes. If you continue to receive this message, contact your Citrix administrator."

Please let me know what else I have to do.
0
 
LVL 37

Expert Comment

by:Carl Webster
ID: 36919068
Looks like it is returning an error that PowerShell cannot handle.
Are the users launching Notepad.ica on your LAN or external?  If external, can you mail me a copy of the ICA file and I will test it here.  Change the file extension to .txt.
0
 

Author Comment

by:hchabria
ID: 36919198
We are in a LAN environment. Citrix applications cannot be accessed from external.

Isn't it possible to trap any errors that is arising while launching the ica file in a LAN environment?
0
 
LVL 37

Expert Comment

by:Carl Webster
ID: 36919553
Only if the ICA client returns an error that can be caught.  Looks like it does not do that.
0
 

Author Comment

by:hchabria
ID: 36919631
Okay. My primary intention is to create a PowerShell script that will launch each application automatically and then report if any fail.

Is there any other way to do the same using PS?
0
 
LVL 37

Accepted Solution

by:
Carl Webster earned 1500 total points
ID: 36920133
I do not see a Citrix supplied PowerShell cmdlet for launching appllications.

These are all I see dealing with applications:

·         Copy-XAApplication                                                                                                    
·         Disable-XAApplication                                                                                                  
·         Enable-XAApplication                                                                                                  
·         Get-XAApplication                                                                                                      
·         Move-XAApplication                                                                                                    
·         New-XAApplication                                                                                                      
·         Remove-XAApplication                                                                                                  
·         Rename-XAApplication                                                                                                  
·         Set-XAApplication                                                                                                      
·         Add-XAApplicationAccount                                                                                              
·         Remove-XAApplicationAccount                                                                                            
·         Add-XAApplicationFileType                                                                                              
·         Remove-XAApplicationFileType                                                                                          
·         Get-XAApplicationIconStream
·         Get-XAApplicationReport
·         Add-XAApplicationServer                                                                                                
·         Remove-XAApplicationServer
0
 

Author Closing Comment

by:hchabria
ID: 36975092
Not what I wanted to get as a solution. However, if there is no solution for that then I am Okay with that. Thanks for your effort.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Citrix XenDesktop, Citrix Studio, Citrix Policies, Citrix XenApp
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question