Thursday, February 4, 2016

Welcome Citrix Technology Professional (CTP) Class of 2016!

Wow! It's hard to believe that a whole year has passed since I was honored by being elected to the CTP Class of 2015. I am also thrilled to have been re-accepted to the program for 2016. It’s been a fantastic year!

What is the CTP Program?

For those who may not be aware, the CTP Program is a group of only 50 individuals worldwide who have invested a significant amount of time and resources to become experts in Citrix products and solutions. The wealth of knowledge they have developed - and more importantly, openly shared - has proven invaluable to the Citrix technology community.  They have consistently demonstrated their real-world knowledge by:

  • Sharing insights (blogging) on web sites and contributing to online discussions (e.g. Citrix forums, Citrix Developer Network)
  • Sharing ideas and code with the Citrix developer community
  • Creating or fostering communities of Citrix users (e.g. CUGC)
  • Publishing technical documentation, articles, or books
  • Offering technical expertise in the field
  • Speaking at IT conferences


CTP members engage with Citrix product teams via in-person meetings and private webinars for detailed discussions on current technologies and product roadmaps. They help shape the future of Citrix technologies by providing valuable input on business needs and feedback on product strategy.

We are proud to welcome the CTP Class of 2016 to the group:


By their continued contributions to the Citrix community, each of the above has proven that they are deserving of the CTP designation. 

Congratulations to the new awardees, as well as to all the CTP members.
You can see the full list of CTP awardees here: CTP Awardees.

CTP accomplishments are reviewed annually, and are evaluated based on recent community contributions. If you have what it takes, I encourage you to apply for the program. You can review benefits and eligibility here: 
Citrix Technology Professionals Program.


Thanks

I would like to thank the following, whose invaluable support has enabled me to continue giving back to the community: 
  • My family
  • The management team and my colleagues at IPM
  • Current and previous CTP members
  • Perrine Crampton and Brad Nunn, CTP Program Managers
  • Citrix 

Tuesday, January 26, 2016

How to Change the Page Title in Citrix Receiver 3.x


During my consulting engagements, I'm always coming across little tips and tricks, which might benefit others in similar situations. Over the course of the coming months, as time allows, I hope to share some of those tips with the community. Feedback is always welcomed.

My first tip is rather a simple one, yet was something that was quite a bit frustrating. In earlier versions of StoreFront, you could change the page title by adding the following code snippet into the JavaScript override file (custom.script.js in the contrib directory):


$(document).ready(function() {
 document.title = "My page title";
});

For StoreFront 3.x, the above script would be placed in the file script.js in the custom directory. If you attempt to do the same thing in StoreFront 3.x, however, you will see your updated title for a fraction of a second, and then it gets replaced by the default text of Citrix Receiver. Obviously, something was being called after script.js.

My next step was to check ctxs.wrstrings.js in <store>web\scripts\<lang code>. This is the template file that you would use to override text string within StoreFront. For example, I would frequently change the StoreFront dropdown from:



to:



To do so, I simply copy the following line from <store>web\scripts\en\ctxs.wrstrings.js:


ActivateReceiver: "Activate ...",

... and copy it to <store>web\custom\strings.en.js, changing the line to read:


ActivateReceiver: "Configure Receiver ...",

Before I continue, I must stress that you do not want to change the template file itself for two reasons. First of all, a StoreFront upgrade would wipe out your changes, and secondly, changes to the template file would not propagate to other servers in the StoreFront server group.
I was hoping to find a line that could be overridden for the page title, but unfortunately, could not find one that fit. Not ready to give up, I searched through the Receiver Customization Extensions and APIs to see if there was something that could help. I came across the afterDisplayHomeScreen() function. So, I added the following to the script.js file in the custom directory:


CTXS.Extensions.afterDisplayHomeScreen = function () {
    document.title = 'My page title';
}

Voila! It worked... sort of. While it did work for the StoreFront applications screen, the logon screen still reverted back to Citrix Receiver. At this point, I reached out to one of my StoreFront gurus, Feng Huang, who graciously provided me with the correct answer. While I was correct in assuming that I would need to add an override string, it wasn't a string that already existed in ctxs.wrstrings.js. I simply needed to add the following into strings.en.js:


AppStore: "My page title",

Problem solved! (and the afterDisplayHomeScreen() function was no longer needed)

Thursday, October 22, 2015

TechTip: Microsoft TS/RDS Updates for Windows Server 2008 and 2012

My colleague Aaron Silber sent over a handy-dandy table with hyperlinks to the Microsoft pages of patches and updates available for Windows Server 2008 and Windows Server 2012.

Terminal Services (Remote Desktop Services) in Windows Server 2008
Remote Desktop Services (Terminal Services) on Windows Server 2008 R2 SP1
Remote Desktop Services in Windows Server   2012
Remote Desktop Services in Windows Server   2012 R2


Friday, October 16, 2015

StoreFront 2.6 and Windows 10 Edge Browser

If you've been following Feng Huang's blog on customizing Receiver, you've probably seen StoreFront 3.0 and Windows 10 Edge Browser. In it, Feng explains how StoreFront 3.0 has been given the smarts to allow you to use the native Receiver with Edge.
What if you are still running StoreFront 2.6 (or 2.5)? Since Edge cannot run the ActiveX controls necessary for client detection, only the HTML5 Receiver would be used (see: Receiver Feature Matrix for HTML5 Receiver limitations).

This post will use a slightly modified version of another one of Feng's posts - Preparing for NPAPI Being Disabled by Google Chrome - to give you the ability to use the native Receiver with Edge.
In that post, Feng discusses how to:

  • Disable the prompt to install the Receiver
  • Provide a permanent link for downloading the Receiver
  • Provide a link to switch between the native (full) Receiver and the HTML5 Receiver (referred to as the 'Lite' version of the Receiver).

However, the modifications discussed in the post are specific to Chrome. With just a bit of tweaking, we can add the above features for any browser.

We begin by adding the following strings to custom.wrstrings.en.js and a localized version for every language you need to support to custom.wrstrings.[language].js. 



Next, we need to add the code below to custom.script.js (in the contrib folder of the StoreWeb site).



The code above adds the following links to the dropdown next to the user's name:








Sunday, September 20, 2015

How to Add a Domain Name Drop-Down for NetScaler Gateway 11

You may have a scenario where users might need to authenticate to different authentication servers (LDAP Domain Controllers) based on their domain. This article describes how to add a drop-down menu with domain names on the logon page for NetScaler Gateway version 11, and have the NetScaler send the authentication request to the appropriate server. While Citrix Support Article CTX118657 describes a procedure to add domain names to the NetScaler logon page, the article is targeted for NetScaler firmware version 10.x, and will not work with version 11.
Citrix has actually added built-in support for a domain drop-down in version 11, but it is not quite fully functional. With a little bit of tweaking, however, it can be up and running in no time.
Note: The following modifications are provided as-is, and are not officially supported by Citrix Tech Support. You may be asked to reverse these changes when calling in for support.
INSTRUCTIONS:
CTX118657 contains four sections:
  • Create the drop-down menu with the list of domain names
  • Create a cookie on the user’s computer with the domain selected by the user
  • Create a procedure to ensure that the modifications will survive a reboot
  • Modify the authentication policy to be selected based on the cookie created
In this post, we will deal with the first two sections. Please refer to the support article for the remaining two sections.

Create the drop-down menu with the list of domain names
The first step is to give NetScaler the list of domain names. To do that, open PuTTY session to the NSIP of your NetScaler, and issue the following command:
> set vpn vServer "<AG vServer>" –userDomains Domain1,Domain2,Domain3

Now fire up WinSCP and go to the directory /netscaler/ns_gui/vpn/js.
Make a backup copy of gateway_login_form_view.js, and search for:
The correct cookie name should be userDomains:
At this point, if you saved the file, and refreshed the NetScaler logon screen, you would see the domain drop-down:
You may notice that there are still two issues … while the drop-down is now being displayed (and there is an entry corresponding to each domain), all the entries are blank!
  
The second issue is more of a cosmetic issue … the screen would look a lot better if the length of the drop-down was the same as the text boxes above it.
To correct the first issue, go back to gateway_login_form_view.js and search for:
The reason that the entries are blank is because the second attribute is incorrect. It should be “text”:
Alternatively, either of the following lines would also work:
   

var option = '<option value="' + domains[j] + '">' + domains[j] + '</option>';
var option = $("<option></option>").val(domains[j]).html(domains[j]);  
Now save the file and refresh the logon page. We now have our drop-down populated with our domains:
 
However, we want to stretch the drop-down to match the length of the text boxes above. We can do that by adding cascading style sheet (CSS) overrides for the height and width of the drop-down. There are 3 built-in themes with NetScaler 11 – Default, Greenbubble, and X1, and the overrides are different for each theme.
In WinSCP, browse to each theme directory, /var/netscaler/logon/themes/<theme>/css/, and create a file called custom.css. Insert the appropriate override values for each theme.
For the default theme, insert:
.domain_select {
       width: 176px;
       height: 23px;
}

For the Greenbubble theme, insert:
.domain_select {
       width: 208px;
       height: 28px;
}

For the X1 theme, insert:
.domain_select {
      width: 361px;
      height: 42px;
}

After saving custom.css, our domain drop-down is now aligned with the rest of the input fields:
Default theme
Greenbubble theme

X1 Theme

Now that we’ve completed the drop down, let’s move on to the next section.
 
Create a cookie on the user’s computer with the domain selected by the user
Fire up WinSCP and make a backup of /netscaler/ns_gui/vpn/login.js.


Add the following JavaScript functions after the first line where indicated above:
 function getCookie(name) {
    // use: getCookie("name");
    var re = new RegExp(name + "=([^;]+)");
    var value = re.exec(document.cookie);
    return (value != null) ? unescape(value[1]) : null;  }

  var today = new Date();
  var expiry = new Date(today.getTime() + 28 * 24 * 3600 * 1000); // +28 days
  var expired = new Date(today.getTime() - 24 * 3600 * 1000); // less 24 hours

  function setCookie(name, value) { 
    // use: setCookie("name", value);
    document.cookie=name + "=" + escape(value) + "; path=/; expires=" + 
                expiry.toGMTString();
  }

  function setDomainCookie(form) {
    setCookie("domainvalue", form.domainvalue.value);
    return true;
  }
Save the file. Now go back to gateway_login_form_view.js (in the js directory).
Look for the line beginning var form = …  At the end of the line, you should see:
Add setDomainCookie(this); right before clean_name_cookie(); (you can optionally also correct the ‘margin’ typo!). This tells the NetScaler to save the user's domain selection before submitting the page.
Save the file.
Now go back to CTX118657, and follow the last 2 sections to complete the modification.
-Sam

Thursday, July 23, 2015

Documenting Citrix StoreFront with PowerShell


Up-to-date StoreFront documentation is essential because it allows you to:

  • Clone a StoreFront server group,
  • Help troubleshoot any issues with the deployment, and
  • Re-create servers after a crash.

Up until now, however, there was no easy way to create reliable StoreFront documentation. Carl Webster has created an amazing collection of automated documentation scripts for Citrix and Microsoft products like Active Directory, XenDesktop, and XenApp, which he offers for free on his website. After talking to Webster, I offered to build a Citrix StoreFront documentation script based on his PowerShell script template for generating documentation in Microsoft Word or Adobe PDF. Being able to use his template gives me the ability to focus just on the StoreFront piece and have Webster worry about Word versions, language packs, etc.


What are they?

The StoreFront scripts are a pair of PowerShell files which create documentation in MS Word, PDF, HTML, or formatted text. The first script (SFServer.ps1) uses the StoreFront PowerShell cmdlets to iterate through the StoreFront configuration which is output to an XML file. This file is used as input to the second script (SFClient.ps1) to produce the actual documentation.


Where can I get them?

The StoreFront scripts have been put into the public domain, and have been added to the extensive collection of scripts on Webster's website. You can always find the latest version of the scripts on his download page.

Please see the included README file for instructions on running the scripts, which may be run either command-line, or GUI (the default).
The scripts have been tested on version 2.x and version 3.0 of StoreFront, though the new features of v3.0 (e.g. App Groups) are not documented in this version.

Thank you to Webster, Barry Schiffer, and all those who helped with testing and suggestions.

Thursday, April 2, 2015

Making a Splash with StoreFront - A Deep Dive!


It’s official! StoreFront is here to stay so let’s ensure StoreFront servers are production-ready through solid documentation. Documentation is essential because is allows you to:
  • Clone a StoreFront server group,
  • Help troubleshoot any issues, and
  • Re-create servers after a crash.
Dive deep with me during my session at Citrix Synergy, where you will see how easy it is to automagically generate awesome StoreFront documentation (in MS Word or PDF format) using the StoreFront PowerShell SDK. You will learn which PowerShell cmdlets are used to document a StoreFront server group  (there are also complementary cmdlets with which you can create/modify your server group).

Plus, the techniques you will learn in this session are not limited to StoreFront! You will learn how to create an intuitive GUI for your PowerShell scripts that can modify itself based upon variables in the script. You will also learn how to add custom icons and graphics to the forms used in your scripts.

As usual, all source code for the session customizations will be made available to presentation attendees.

So join me at Citrix Synergy for SYN417: StoreFront PowerShell documentation deep dive, on Tuesday, May 12 from 4:00-4:45 PM PST time in Valencia Ballroom D. Let me show you how to produce awesome StoreFront documentation, and become more proficient in PowerShell in the process.  Hope to see you there!