Use PowerShell to get the Citrix Configuration Log as well as Old and New Property Values

This is a quick tip to show you how to get the Citrix Configuration Log, plus all the old and new property values, and convert this all to JSON.

Here is a quick tip for you. I had a need to get the Citrix Configuration Log, so I dropped into PowerShell and ran Get-CtxConfigurationLogReport. That is all good and well, but you do not get all the old and new values of the changed properties. However, converting this output to JSON will do just what I want. Plus, converting to JSON is better for me anyway as I want to push this stuff over to Splunk to do some analytics. Here is what you need to do:

Step 1 – Create your UDL file to connect to the database

Add-Content C:\conflog.udl –Value $null; Start-Process C:\conflog.udl

This will prompt you for your SQL credentials. You can use Windows integrated security if you like, but I’m saving my creds for later use outside of my interactive PowerShell session later.

Citrix Config Log UDL

 

Step 2 – Get the things

# Load the Citrix Common Commands Snapin
Get-PSSnapin -Registered "Citrix.Common.Commands" | Add-PSSnapin

# Get the configuration log and convert to JSON
Get-CtxConfigurationLogReport -DataLinkPath C:\conflog.udl | ConvertTo-Json -Depth 10

 

Here is some sample output (notice the property old and new values)

{
    "EntryId":  "3_0_3",
    "Date":  "\/Date(1443804400000)\/",
    "Account":  "LAB\\administrator",
    "TaskType":  2,
    "ItemType":  0,
    "ItemName":  "Calc",
    "Description":  "Published application Calc was modified.",
    "Details":  [
                    {
                        "PropertyName":  "Application Description",
                        "OldValue":  "Calculator",
                        "NewValue":  "Calculator 123"
                    }
                ],
    "References":  [
                   ]
}

Note, this requires PowerShell 3.0

Here is a Gist as well -> https://gist.github.com/JasonConger/62b9c6ce165503a3112c

 

Citrix Synergy 2015 Day 2 Keynote Live Blog

The day 2 keynote this year is focused on things that are yet to come.  Traditionally, the first day keynote intermingled the “what’s available now” stuff with the “what’s coming in the next 6, 12, 18, n” months.  By breaking these things up into 2 days, it is a little more clear that what is shown today isn’t readily available, but is more of the direction of Citrix. Continue reading “Citrix Synergy 2015 Day 2 Keynote Live Blog”

Citrix Synergy 2015 Day 1 Keynote Live Blog

Here we are again at Citrix Synergy. I will be live blogging the keynote here. Content will scroll up as I post it. Also, you can follow me on Twitter (@JasonConger) for updates.

Here we are again at Citrix Synergy. I will be live blogging the keynote here. Content will scroll up as I post it. Also, you can follow me on Twitter (@JasonConger) for updates. Continue reading “Citrix Synergy 2015 Day 1 Keynote Live Blog”

Citrix Workspace Services – Friend or Foe for the Citrix Service Providers (CSP)?

At Citrix Synergy this year, the “one more thing” at the end of the keynote was a new offering called Citrix Workspace Services. There was immediate debate on Twitter as to how this impacts certain market segments. This article covers ways in which Citrix Workspace Services could help or hinder the Citrix Service Provider Market.

At Citrix Synergy this year, the “one more thing” at the end of the keynote was a new offering called Citrix Workspace Services.  Brian Madden wrote an article explaining what CWS is and isn’t, but I wanted to take a look at this from a Citrix Service Provider’s perspective.

Where Citrix Workspace Services Fit

Automation and self-service are two major factors for CSPs.  Citrix Workspace Services potentially helps with both of these factors.  Since CWS isn’t a real thing yet that we can get our hands on, I’m not quite sure to what extent we can automate things.  This is important because CSPs have to automate in order to keep costs down and still maintain enough margin to remain profitable.  Automation is also key because CSPs are not merely delivering just a remote desktop; they are delivering a suite of services, apps, data, backup, etc. and Citrix is a portion of the overall offering.  Self-service is also important for CSPs because people are expensive.  The more you can offload to the tenant via self-service (which relies on automation) the less man power you need.

 

How Citrix Workspace Services Work

XenApp and XenDesktop environments need five basic things to work:

  1. Database
  2. License Server
  3. Controller(s)
  4. VDA(s)
  5. StoreFront

Citrix Workspace Services can move 4 out of 5 of those things to the cloud (Azure for now).  Basically, all you need is the workloads (VDAs) on your premises.  Then, you just point those VDAs to the provisioned Citrix Workspace Service instance in Azure and off you go.  Since a picture is worth a thousand words, here ya go:

Citrix Workspace Services

 

Does this help or hurt the CSP?

So the question is, “is Citrix Workspace Services a slap in the face to CSPs”?  I personally believe CWS could be a huge help to CSPs.  When I was the Director of Technology for Xcentric (a CSP), I would have loved to have this.  There are less moving parts for me to manage and on-boarding new clients could potentially be sped up as there is less work for the CSP to do.  Keep in mind that a lot of my opinion hinges on the automation aspects of CWS (which is still unknown at the time of this writing).  There could be some inherent risk in potential down time, but a CSP tenant is already prepared for a risk like this by the shear nature that they signed up for a hosted service the CSP provides in the first place.

On the converse, stealing a line from @Shawn Bass, CWS could potentially cause a CSP market saturation as CWS lowers the bar of entry.  You no longer need a significant capital expenditure to get started as a CSP.  I personally do not see this happening, but time will tell.

 

What is lacking (potentially)?

The automation question is still up in the air.  I believe Citrix will make this a solution that can be automated with APIs, but how easily CSP can hook into whatever Citrix offers could potentially hinder the CSPs workflow.

Compliance (SAS, HIPPA, PCI, etc.).  In most cases, data is still kept with the CSP, but potential identifiable information could flow from CSP to Azure and back (although this is yet to be determined).  This could be a show stopper for certain markets.

Moving from Citrix Workspace Services to on premises.  Since CWS was built using Azure services like Azure App Services, Azure Active Directory and Azure Virtual Network, it would be nearly impossible to move from CWS back to on premises.  It’s kind of like the Mob – once you’re in you’re in, and you’re not getting out.

Reporting is yet to be seen, but I sure hope Citrix builds this in for SPLA-like reporting.  All CSPs have to report to at least Microsoft and Citrix on a monthly basis about usage and pay up as you go/grow.  I used to rely on home-grown tools to do this, but it would be better to have this from the vendor.

 

Conclusion

So, I think CWS will be a major help to CSPs as long as there is a strong and extensible automation engine involved.  Could there be downtime that has nothing to do with the CSP-owned infrastructure?  Sure, but that is the nature of the business in the first place.  There are still lots of unknowns, but I’m hopeful as this just seems to make sense to me.

What do you think?

 

 

Citrix Synergy 2014 Live Blog

Citrix Synergy is back in Anaheim, California this year and I will be live-blogging the keynote. You can watch the keynote live at CitrixSynergy.com as well. I am sure there will be a focus on mobility, but with the release of XenDesktop and XenApp 7.5, I am excited to see Citrix getting back to the future (again).

It is time for Citrix Synergy, and I will be live-blogging the keynote. You can watch the keynote live at CitrixSynergy.com as well. I am sure there will be a focus on mobility, but with the release of XenDesktop and XenApp 7.5, I am excited to see Citrix getting back to the future (again). You can also follow me on Twitter for more updates throughout the conference. Continue reading “Citrix Synergy 2014 Live Blog”

Using PowerShell to Retrieve Citrix Monitor Data via OData

Starting with XenDesktop 7, Citrix stores the data the Desktop Director displays in a SQL database. Citrix opened up this data via a Monitor Service API that uses OData.  I’m not going to go deep into the details of the API as it is fairly well documented at the eDocs site.  The examples in the documentation show you how to access this data via web browser, Microsoft Excel, and LinqPad.  What I want to do in this article is show you how to use PowerShell with this API.

To start out, let’s take a look at the Citrix Monitor Service schema (click to enlarge):

 

MonitorDataSchema

Suppose we want to get all sessions as well as the all the connection/disconnections to the session.  The following URL will return the data we want in XML format.

http://localhost/Citrix/Monitor/Odata/v1/Data/Sessions

The trick to get this working with PowerShell is to transform all this information into a nice hierarchical structure.  In the example code below, we use the Invoke-ODataTransform function to do this.

function Global:Invoke-ODataTransform ($records) {

    $propertyNames = ($records | Select -First 1).content.properties |
        Get-Member -MemberType Properties |
        Select -ExpandProperty name

    foreach($record in $records) {

        $h = @{}
        $h.ID = $record.ID
        $properties = $record.content.properties

        foreach($propertyName in $propertyNames) {
            $targetProperty = $properties.$propertyName
            if($targetProperty -is [System.Xml.XmlElement]) {
                $h.$propertyName = $targetProperty.'#text'
            } else {
                $h.$propertyName = $targetProperty
            }
        }

        [PSCustomObject]$h
    }
}

$connections = ""
$uri = "http://localhost/Citrix/Monitor/OData/v1/Data/Sessions?`$expand=Connections"
$connections = Invoke-ODataTransform(Invoke-RestMethod -Uri $uri -UseDefaultCredentials)

foreach($connection in $connections)
{
    $output = $connection | Get-Member -MemberType Properties | ForEach-Object {
        $key = $_.Name
        $value = $connection.$key
        '{0}="{1}"' -f $key,$value
    }

    Write-Host $output
}

Citrix Synergy 2013 Live Blog

Citrix Synergy is in Anaheim, California this year. With the recent release of Excalibur, it will be interesting to see what is revealed during the keynote. I’ll be live-blogging the keynote this year. Check it out here or on Twitter @JasonConger.

It is time for Citrix Synergy, and I will be live-blogging the keynote. With the recent release of Excalibur, I expect the keynote focus to be a lot around capabilities and features. I also expect to see some more around mobility, networking, and cloud. Be sure to stay tuned here and/or follow me on Twitter.

Continue reading “Citrix Synergy 2013 Live Blog”

Citrix Synergy Barcelona 2012 Super Session (day 2) Live Blog

It is day 2 of Citrix Synergy Barcelona and it is time for the Super Session (a.k.a. day 2 keynote). Keep up on the action with this live blog.

Yesterday, we heard a lot of announcements from Citrix.  Today is the super session and I’ll be live blogging again here.

Continue reading “Citrix Synergy Barcelona 2012 Super Session (day 2) Live Blog”

Citrix Synergy Barcelona 2012 Keynote Live Blog

Citrix Synergy has returned to Barcelona, Spain. That means that I will be live blogging the keynote again this year.

Citrix Synergy has returned to Barcelona, Spain.  That means that I will be live blogging the keynote again this year.  Last year in Barcelona and earlier this year in San Francisco, Citrix talked a lot about public/private/personal cloud.  I am looking forward to see som fruition out of their vision.  I also fully expect Mark Templeton to have “one more thing” at the end of the keynote as well.  Stay tuned… Continue reading “Citrix Synergy Barcelona 2012 Keynote Live Blog”

Citrix Synergy Day 2 Keynote Live Blog

It is day 2 of Citrix Synergy 2012 and I’ll be live blogging the event. For highlights from yesterday’s keynote, check out this post.  This keynote should be a bit more demo oriented about current products rather than future-focused.  Stay tuned… Continue reading “Citrix Synergy Day 2 Keynote Live Blog”

Citrix Synergy 2012 Live Blog

It’s time for Citrix Synergy 2012. I’ll be live blogging the keynote again this year. I’m looking forward to hearing about some of the Cloud/multi-tenant announcements and mobility improvements.

It’s time for Citrix Synergy 2012. I’ll be live blogging the keynote here. I’m looking forward to hearing about some of the Cloud/multi-tenant announcements, mobility improvements, and desktop management. Continue reading “Citrix Synergy 2012 Live Blog”

Setting up an Android Emulator for use with Citrix XenApp 6.5 Mobile Application SDK

One of the coolest SDKs I’ve seen come out in quite a while is the Citrix XenApp 6.5 Mobile Application SDK. As of this writing, only the Android version of the Citrix Receiver is supported so I will show you how to set up an Android emulator with the Citrix Receiver for testing purposes.

One of the coolest SDKs I’ve seen come out in quite a while is the Citrix XenApp 6.5 Mobile Application SDK. Citrix defines the XenApp 6.5 Mobile Application SDK as “… a rich tool kit for developers to write touch-friendly, mobilized applications that are hosted on Citrix XenApp and delivered to any device with Citrix Receiver. These mobilized applications are able to leverage a wide set of mobile device functionality including GPS, sensors, cameras, and device buttons in the same way that locally running, native applications do.”

As of this writing, only the Android version of the Citrix Receiver is supported (iOS is on the way).  Since I do not own any Android devices and I was anxious to get started, I had to set up an emulator and install the Citrix Receiver to get going with the SDK.  Here is how I did it.

 

Install the Android SDK

Go to the Android SDK download page (http://developer.android.com/sdk/index.html) and pick the correct installer for your platform. I’m using Windows, so I chose the .exe installer file.  After you run this .exe, you still do not have the emulator.  The reason for this is the Android SDK archive initially contains only the basic SDK tools. It does not contain an Android platform or any third-party libraries. You must install the Platform-tools and at least one version of the Android platform using the SDK Manager.

Android SDK Manager

I installed the Android SDK Platform-tools and all options for Android 4.0.3.

After the install completes, be sure to add %ProgramFiles%\Android\android-sdk\platform-tools to your PATH environment variable.  This will be handy later for installing the Citrix Receiver.

 

Create an Android Virtual Device

After the installs complete, you can launch Android Virtual Device Manager (AVD Manager). This can be found in the Windows start menu under Android SDK Tools \ AVD Manager. AVD Manager is used to create various virtual devices running the Android OS.

Android Virtual Device for XenApp 6.5 Mobile Appliction SDK
As you can see, I created an Android 4.0.3 device with 100 MiB of local storage. The more storage you add to your AVD, the longer it will take to boot. Since this AVD is only being used for XenApp 6.5 testing, I only allocated 100 MiB. The first boot of your AVD will take a little longer than subsequent boots.

 

Download the Citrix Receiver for Android

Now that we have a functioning Android emulator, we need to get the Citrix Receiver installed. The first thing we need to do is download the .apk (Android Package) file. Normally, I would just go to http://www.citrix.com/receiver and choose “Android”. But, as of this writing, when you do that, you are redirected to the Android Marketplace. Unfortunately, Android Marketplace does not work on the Android Emulator. So, here is what you can do instead:
Go to http://www.citrix.com/downloads and choose “Receiver for Android” from the drop down list. From there, you can select the Android client and download the .apk.

 

Install the Citrix Receiver for Android

Ok, so now we have a functioning Android emulator and the Citrix Receiver downloaded. The final step is to install the Citrix Receiver onto the emulator. Here’s how:

  1. Copy the .apk file to %ProgramFiles%\Android\android-sdk\tools
  2. Open a command prompt and change the directory to %ProgramFiles%\Android\android-sdk\tools
  3. With the AVD you created running, execute the following command:
adb install <name of Citrix Receiver>.apk

Citrix Receiver for Android

 

You now have a fully functional Citrix Receiver running on an Android emulator.  My next post shows you how to set up a development environment to utilize the Mobile Application SDK and compile some of the examples.

 

Citrix Synergy Barcelona 2011 Keynote Live Blog

Citrix Synergy 2011 is going on now in Barcelona. I’ll be live blogging the event here. Expect to see more information about recent Citrix acquisitions.

Citrix Synergy 2011 is going on now in Barcelona. I’ll be live blogging the event here. Expect to see more information about recent Citrix acquisitions. I will be tweeting the event as well. Be sure to follow @CitrixSynergy if you are not already. Continue reading “Citrix Synergy Barcelona 2011 Keynote Live Blog”