Showing posts with label Powershell and Citrix. Show all posts
Showing posts with label Powershell and Citrix. Show all posts

Monday, May 28, 2012

Citrix and Powershell Remoting

 

A person who never made a mistake never tried anything new”
                                                                                                                                                                                -Albert Einstien

In this one, I will try to show the good old PowerShell Remoting and Citrix Remoting. Please note that you can only use Citrix Remoting only if you have XenApp 6.5 Servers running in your farm. If you have XenApp 6 or below versions supported by Citrix then you  have to rely on PowerShell remoting.

If you want to know about PowerShell Remoting then I highly suggest the following free-ebooks

MVP Ravikanth’s “Layman’s Guide to PowerShell Remoting

PowerShell Guru MVP Don Jones & MVP Tobias Weltner’s “Secrets of PowerShell Remoting

 

I have a Lab Setup with:

·         domain name POSH.com …….(cool isn’t it :P )

·         Administrator Workstation named “POWERSHELL” (PowerShell SDK for XenApp 6.5 installed )

·         Remote XenApp 6.5 Server “CTXXENAPP01” with PSRemoting enabled.

·         User POSH\201210 has  full Farm Admin privileges.

 

Citrix with PowerShell Remoting

Open the PowerShell Console. And create a  New PowerShell Session in the remote Citrix XenApp Server using the full Farm Administrator Credentials

clip_image002

After Opening the PowerShell Session in the Remote Citrix Server. Enter the Session using the –Id parameter.  Once you enter the Remote PSSession the console is prepended with the Remote Citrix XA Server Name .

clip_image004

Now , Get all the Snap-ins available in the Citrix XA Server. The following snapshot shows the Snap-ins registered with the Citrix PowerShell SDK , the ones we are interested in are Citrix.Common.Commands, Citrix.Common.GroupPolicy  and Citrix.XenApp.Commands.

clip_image006

 Now load the specific Snap-ins one-by-one or just add them using a wild-card (your choice). Notice that I had Citrix WorkFlow Studio installed too in my Remote Citrix XA Server, so those snap-in also get loaded if I use  a wild-card.

clip_image008

After the Citrix XA Snap-ins are loaded, to have a look at  all the new cmdlets available to manage XA Farm. You can use noun “XA*” with Get-Command because Citrix Cmdlets have XA prepended in the Noun part of Verb-Noun naming convention to easily identify them. There is also a cmdlet that comes with these Snap-ins Get-CtxCommand  which does the same.

clip_image010

Now Citrix XenApp Server is on-demand application delivery solution. So it deals mostly with administration of published Applications. So let’s search something like XAApplication with Get-Command. This will yield all the cmdlets that are available to administer Applications. 

clip_image012

Now time to explore.  The best thing about PowerShell is it’s documentation right. Don’t Worry Citrix also provides you a great Offline help documentation. Now you can look at the examples and get what the cmdlet does for you.

clip_image014

Viewing the Examples. Pretty self explanatory examples …I guess J

clip_image016

Now let’s execute a simple cmdlet Get-XAApplication. Now this cmdlet retrieves all the published Application informationclip_image018

 If you wanted a detailed information then you could use Get-XAApplicationReport.

clip_image020

The best thing about using PowerShell is whatever you have learned ….can be incorporated here too. For example in following example Invoke-Command is used to retrieve the published application information from the remote Citrix XA server and then that information is being piped into Out-file cmdlet to store it into a text file.

This is a very naïve example here but look at the Power it holds for Citrix XA Farm Admins. Suppose you wanted to get the list of  all the published applications in different farm ,  generate a report for Server memory  Optimization Information , retrieve Citrix Load Evaluators and much more.

clip_image022

 

A Little bit on Citrix Remoting

XenApp 6.5  PowerShell  SDK  for Citrix comes with a brand new feature Remoting , which was earlier not present in the XenApp 6 PowerShell SDK. All the cmdlets shipped with the SDK now support a –computername  parameter  which indicates  to the cmdlet to execute remotely. Now this has  a huge impact , such that now I can install the PowerShell SDK on any machine ( Windows Machine) running PowerShell v2.0 and manage my farm from there. Note that no additional configurations are needed in the client or server.

XenApp 6.5 implements this new feature by introducing a new Windows Communication Foundation (WCF) service named Citrix XenApp Commands Remoting. This service implements Remoting in the XenApp 6.5.

Following is a status of the Citrix Remoting Service running on the XenApp 6.5 Server.

clip_image024

To use Citrix Remoting , you don’t need to install the PowerShell SDK on the Remote Citrix XA Server instead you install it on the local  Administrator Workstation and load the snap-ins and use the commands like native PowerShell cmdlets specifying the remote Citrix XA Server to contact using –computername parameter. It’ll look something like this

clip_image026

I have tested this one and this works fine as well, But as of now didn’t had a proper screenshot. I will try to cover this one later with proper steps.

 

Thanks

Deepak Singh Dhami
Deepak Singh 

Monday, May 14, 2012

Powershell and Citrix:Citrix Support for PowerShell.

 

“The only thing that interferes with my learning is my education”.-Albert Einstein

 

In the earlier Blog Post , Our System got up and ready for Using Citrix PowerShell SDK to manage our Farms.

But before going any further it is important to know about the appropriate Citrix PowerShell SDK you would be using along with any limitations.

Now for the Older Citrix Product like XenApp 5.0 and Presentation Server 4.5, the management was done using MFCOM but Microsoft and partners are pushing PowerShell as the new console-based management and automation tool. This doesn’t came as a shock when Citrix ( M$ partner ) decided to support PowerShell.

New Citrix Products XenApp 6.0 and XenApp 6.5 are provided with a PowerShell SDK.But the XenApp 5.0 and Presentation Server 4.5 Admins needn’t to settle for less, Citrix provides the XenApp Commands CTP for these older release. Any version below Presentation Server 4.5 can’t be used with PowerShell.

Let’s delve into these one –by-one and try to explore the functionalities provided with each of them. I have used the Citrix Community Sites for this information and I may have have misunderstood few things….feel free to correct me any time.

Targeted Platforms

Pre-Requisite

Citrix XenApp Commands CTP

This Tool Pack runs on the following platforms:

· XenApp 5.0 for Windows Server 2008 x64.

· XenApp 5.0 for Windows Server 2008 x32.

· XenApp 5.0 for Windows Server 2003 x64.

· XenApp 5.0 for Windows Server 2003 x32.

Following platforms were not targeted for this Tool Pack, but might be functional:

· Presentation Server 4.5 for Windows Server 2003 x64 with HRP3 installed.

· Presentation Server 4.5 for Windows Server 2003 x32 with HRP3 installed.

· PowerShell v 1.0 or later

· .NET Framework 3.5 SP1

XenApp 6 PowerShell SDK

· XenApp 6 for Windows Server 2008 R2 x64.

(PowerShell Remoting used)

· MSI 3.0

· PowerShell 2.0 + WMF 2.0

· .Net 3.5 SP1

XenApp 6.5 PowerShell SDK

· XenApp 6 for Windows Server 2008 R2 x64.

(Citrix Remoting feature used)

· Any Windows Client with PowerShell v2.0 (PowerShell Remoting used)

  • MSI 3.0
  • PowerShell 2.0
  • .Net 3.5 SP1

**********************************

XenApp Commands Technology Preview

These commands are a PowerShell Tool Pack that allows managing most aspects related to XenApp.  They cover all of MFCOM functionality for features available in XenApp 5 and include functionality from both AMC and CMC.  The Commands target XenApp 5 for both W2K8 and W2K3.

This Tech Preview is now open to everyone with a MyCitrix account. The current tool pack is CTP3, and you can read the Release Notes at :

https://www.citrix.com/site/resources/dynamic/dlshareddocs/XenApp_Commands_CTP3_Release_Notes.htm

Note! This tool pack is provided without any warranty.

Features with CTP

This release provides the following management functionality that is provided by the Access Management Console’s Presentation Server extension e.g.  Application publishing, Farm and Server configuration etc. This release also includes features of XenApp Advanced Configuration:  Policies,  Printer Management,  Load Management

This release does not cover functionality outside the scope of those components, such as Hotfix Management, Report Center, Licensing and Diagnostic Facility features.  Features that were removed during the XenApp 5.0 release are also not supported, such as Resource Manager and Monitoring Configuration.

**********************************

XenApp 6 / XenApp 6.5 PowerShell SDK

Both of these SDKs have standard modules, these were already explained in previous post.

· Citrix XenApp Commands

· Citrix Group Policy Provider

· Citrix Common Commands

There are few more features that are shipped with XenApp 6.5 PowerShell SDK which are not available with XenApp 6.0..But I think Citrix provides free upgrade from XenApp 6.0 to XenApp 6.5 (using a PowerShell based uitilty..this was obvious right ? ) So it’s better to go with XenApp 6.5 to use all the features.

The most distinguishing feature in XenApp 6.5 SDK is

Remoting :All the cmdlets now support a -ComputerName parameter which indicates to the cmdlet to execute remotely. This means that the snap-in now can be installed anywhere and no additional configurations are needed in the client or server , so you can use any Windows Client with PowerShell 2.0 and manage the Farm.

To accomplish this feature, a new WCF service (Citrix XenApp Commands Remoting) was introduced in XenApp, which takes care of all the business.

Apart from Remoting , there is also feature to set default computername for remoting and using Object Ids , will try to cover these later.

So I am using a Lab Environment having XenApp 6.5 and the proper SDK installed , in next post will use PowerShell Remoting to perform simple tasks.

Thanks

Deepak Singh Dhami

Deepak Singh

Monday, May 7, 2012

Powershell and Citrix: Installing Citrix PowerShell SDK on XenApp Server/or Windows Client

written by: Deepak Singh Dhami.
"A teacher who is attempting to teach without inspiring the pupil with a desire to learn is hammering on cold iron" 
Hello Power Users!
When I started learning Citrix, I was very excited about the fact that Citrix provides PowerShell SDK to manage the XenApp Farms.  One has to install the SDK in the Remote XenApp Server or the local machine to start using PowerShell cmdlets to manage the Farm. These cmdlets provide extra functionality not achievable from the GUI.
In this post we will get our system ready for using Citrix SDK. 
Getting the System Up and Ready for Action:
********************************************************************

Installing Citrix PowerShell SDK on XenApp Server/or Windows Client.
First of all get the appropriate SDK for your Server. I have a XenApp 6.5 Server running in my Environment. So I downloaded appropriate one ...Note here that the functionality may be limited with the version of XenApp and PowerShell SDK you are using (will discuss this at length in later post). 
You can download the Citrix PowerShell SDK by using following link:
For Citrix XenApp 5.0 (in Windows 2008 and 2003), you'll need to register yourself to get this one. 
 For Citrix XenApp 6.0,
For Citrix XenApp 6.5,
Run the Installer executable on a Client or XenApp Server to be presented with a License Agreement.
You know what to do here… ;)
I mean read the whole license here…...C'mon who does that :P
clip_image002
    Figure 1 
Now after the tiresome reading of the Agreement. You'll be presented with a Screen like Figure2:
The components that will be installed with the Citrix PowerShell SDK are explained as below: 
Citrix XenApp Commands
These cmdlets expose a consistent command line and scripting experience for XenApp Farm Admins. Note that all the Farm Management tasks can be performed using the cmdlets and moreover these cmdlets provide functionality that is not provided with a traditional GUI that is Citrix Delivery Services Control / Citrix App Centre. 
Citrix Group Policy Provider
The Citrix Policy provider lets you examine, edit, clear, and copy policies and policy settings that are stored in any GPO. When the provider is loaded, it creates the LocalGpo and LocalFarmGpo drives to refer to the local Windows policy and any Citrix policy that is applied to the XenApp farm where the server is a member.
Citrix Common Commands
The Citrix Common Commands provide functionality common to all Citrix products. The Common Commands are exposed through the snap-in: Citrix.Common.Commands. 
clip_image004
         Figure 2 
Installation Complete 
clip_image006
    Figure 3
I am using the XenApp 6.5 SDK and it comes with a new feature called Remoting. Note this Remoting is different than the PowerShell Remoting.  
Note:  I will be covering two scenarios in upcoming blog posts
1.      Using PowerShell Remoting
2.      Using Citrix Remoting
Stay tuned for more citrix related stuff...
Thanks
Deepak Singh Dhami
Deepak Singh