Posts RSS Comments RSS 253 Posts and 411 Comments till now

Archive for the 'Citrix' Category

BriForum rocked!

As I am sitting here on my way back to NJ from BrForum I am thinking about the week. All I can say is awesome. The content was only matched by the company. People often underestimate the value in conferences and often it is not the actual sessions. In the case of BriForum there is significant value in both. If you have never been to BriForum and you are in the SBC (server based computing) world you are missing out.

p.s. @ShawnBass, @JasonConger, @LauraWhalen, @JimMoyle. You guys rock and I had an absolute blast.

Blogging from iPad

Trying out the new iPad app for WordPress. Typing is not perfect but it is not to bad either.

For those of you wondering I got an iPad because of the Citrix receiver. It make the device priceless. IMO… Everyone should have one.

XenApp cmdlets are HERE!!!

This is still a CTP of sorts, but it is open to the public. These are high quality and I suggest you give them a try.

You can download here: XenApp cmdlets

I hope to have some demos up soon, but until then my old demos should still work.

Citrix License Info (using WMI)

I had several questions about this so I decided I should figure it out and Post. It was surprisingly simple. All I needed was the WMI provider and from there it was cake. If you’re curious how I figured out the WMI namespace I used WMI Explorer from MoW [CLICK HERE To Read about it].

The Output will look like this
Citrix License Script Ouput

Here is the Code

# Get-CitrixLicensing
$licensePool = gwmi -class "Citrix_GT_License_Pool" -Namespace "ROOT\CitrixLicensing" -comp $LicenseServer
$licensePool | Select-Object @{n="Product";e={$_.PLD}},
                            @{n="In Use";e={$_.InUseCount}},
                            @{n="% in use";e={($_.InUseCount/$_.Count)*100}}

Citrix and Powershell Webinar

For those of you that use Citrix Presentation Server you will want to watch this. I maybe a little bias, but I loved it 🙂

Powershell and MFCom (Citrix takes more steps)

Vishal Ganeriwala is hosting a webinar on the 29th of April on Powershell and MFCom. This is just another example of Citrix actively embracing Powershell.

It will cover some basic Powershell for those who do not have much XP with Powershell.
– What is an Object
– Properties
– Methods
– New-Object (-ComObject)

It will also cover how to create a Citrix Farm Object in Powershell and some of the interactive nature of Powershell
– Getting Farm Properties
– Getting Applications
– Getting Servers
– Getting Sessions

– Get Current Sessions Client Resolution

Citrix Script Repo (aka Exchange)

I was recently directed to a new website (for me at least) that contains a repository of Citrix related scripts. There are some pretty useful scripts posted (and I started adding some Powershell ones.) You should check it out

Script Exchange

I would also recommend RSS’ing Vishal blog (Dev at Citrix.) He has a passion for Powershell and I hope to see some awesome things from him in the future.

Vishal Ganeriwala’s Blog

Get-CitrixApplication.ps1 (Citrix Top 10)

This script returns Citrix Application Objects.
– With no -AppName passed it will return All application Objects
– With -AppName it will return all apps that match (regex.)

# Get-CitrixApplication.ps1
# Brandon Shell [MVP]
# Returns Citrix Application Objects for AppName passed or RegEx
$type = [system.Type]::GetTypeFromProgID("MetaframeCOM.MetaFrameFarm",$server)
$farm = [system.Activator]::CreateInstance($type)
$farm.Applications | ?{($_.AppName -match $AppName) -or ($_.BrowserName -match $AppName)}

Set-CitrixServerLogon.ps1 (Citrix Top 10)

Here is a useful little script. This Creates a MFCom Server Object and disables or Enables Logons for that Server.

# Set-CitrixServerLogon.ps1
# Brandon Shell [MVP]
# Sets the Server to Enable or Disable Logons
function HelpMe{
    Write-Host " Set-CitrixServerLogon.ps1:" -fore Green
    Write-Host "   Sets the Server to Enable or Disable Logons"
    Write-Host " Parameters:" -fore Green
    Write-Host "   -Server                  : Optional. Server to Set Logon"
    Write-Host "   -Enable                  : Optional. Checks Hours of Idle Time (Default)"
    Write-Host "   -Disable                 : Optional. Checks Minutes of Idle Time"
    Write-Host "   -Help                    : Optional. Displays This"
    Write-Host " Examples:" -fore Green
    Write-Host "   To disable the Logon for a Server" -fore White
    Write-Host "     Set-CitrixServerLogon.ps1 -server <serverName> -Disable" -fore Yellow

if(!$Server -or $help){helpme;Write-Host;return}


Write-Host " Getting Server [$Server]"
$mfsrv = New-Object -ComObject MetaFrameCOM.MetaFrameServer

Write-Host " – Initializing Server"

    Write-Host " – Setting to EnableLogon = 1"
    $mfSrv.WinServerObject.EnableLogon = 1
    Write-Host " – Setting to EnableLogon = 0"
    $mfSrv.WinServerObject.EnableLogon = 0

Write-Host " – Server [$($mfSrv.ServerName)] is set to [$($mfSrv.WinServerObject.EnableLogon)] for EnableLogon"


Another option would be to remove the Apps from the Server all together.

# Unpublish-CitrixServer.ps1
# Brandon Shell [MVP]
# Removes all App from Server
$mfsrv = New-Object -ComObject MetaFrameCOM.MetaFrameServer
$mfsrv | foreach{$_.Applications} | foreach{$_.LoadData(1);$_.RemoveServer($Server.ToUpper());$_.SaveData()}

Get-CitrixAppServer.ps1 (Citrix Top 10)

This is pretty simple script. It is actually just an adaption from my Get-CitrixApplication.ps1 script posted at the bottom. There is a moment in time when you start thinking in terms of objects and stop thinking in terms of text output you are looking for.

This will make a huge difference in productivity and take you from constantly writing scripts to interactively getting the information you are after, but until you make the transition I will continue to provide scripts that do both 🙂

# Get-CitrixAppServer.ps1
# Brandon Shell [MVP]
# Gets All the Servers for Specific App
$mfApp = New-Object -ComObject MetaFrameCOM.MetaFrameApplication
$mfApp.Servers | %{$_.ServerName}

Here is the script that I use to return an Application object.

# Get-CitrixApplication.ps1
# Brandon Shell [MVP]
# Gets a Citrix Application Object.
$mfApp = New-Object -ComObject MetaFrameCOM.MetaFrameApplication

Then from the commandline I would just do this
PS> Get-CitrixApplication.ps1 “Applications\MyApp1” | %{$_.Servers} | %{$_.ServerName}

While this looks more complicated it is more versatile and easy to change. Lets say I want current User for this app instead.
PS> Get-CitrixApplication.ps1 “Applications\MyApp1” | %{$_.Sessions} | %{$_.UserName}

Next »