Application virtualization, IoT and Cloud Computing, Blog of Sacha Thomet

Have a look into the StoreFront 2.x Subscription Database

Last days I had to deal with Citrix StoreFront 2.0 and found out that a numerous issues still exists and that some things are still not implemented to configure in the StoreFront MMC SnapIn.

Session timeouts and settings like enable or disable of features like workspace control still must be handled over the config-files. But this is all well documented the official documentation of Citrix.

But seems there is no possibility to have a look into the subscription database from Citrix Storefront which is now with version 2.0 in a proprietary non-MSSQL format. For this reason I created this small script (execute it on the StoreFront server):

#========================================================================
# Created on: 22.10.2013
# Created by: Sacha T. blog.sachathomet.ch
# Filename: GetSubscriptedStoreFrontApps.ps1
#========================================================================
#define some variables
#$domainname = "anotherDomain" # use that if your user is in another domain
$domainname = $env:userdomain
$storename = "StoreFront"      # Change this to your Store-Name
$subinfofile = "C:\temp\temp-subscriptions.csv"
Write-Host Query StoreFront apps in domain $domainname in Store $storename
$username = Read-Host "Please enter username to query"
#Add Module for Citrix StoreFront
Import-Module "C:\Program Files\Citrix\Receiver StoreFront\Scripts\ImportModules.ps1"
#Change username to domain SID
$objUser = New-Object System.Security.Principal.NTAccount($domainname, $username)
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
#delete old Subcriptionexportfile
Remove-Item $subinfofile -ErrorAction SilentlyContinue
#Create new Subcriptionexportfile
Export-DSStoreSubscriptions -StoreName $storename -FilePath $subinfofile
##Add a caption to the file, this is needed to process csv
$content = Get-Content $subinfofile
Set-Content $subinfofile sid.app
Add-Content $subinfofile $content
#Read all Lines in CSV from this User which are not unsubscribed
import-csv C:\Temp\temp-subscriptions.csv -delimiter "."| Where-Object {$_.sid -like "$strSID*" -and $_.app -notlike "*unsubscribed*"}| Format-Table -Property app
#wait to read the result - usefull if started from WindowsExplorer with "Run in PowerShell"
Write-Host "Press any key to continue …"
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")

 

When I’ve created this script I found out that deleted apps wont be removed from the subscription database and as well users who leave the company will still have records in the database after they are deleted in the AD. So within the years, the subscription database will have a lot of orphan data in the database. Seems that an automated clean-up does not exists.

There is a way to delete the records, have a look to forum post of Duncan Gabriel Thread:

Delete user subscriptions?  http://forums.citrix.com/thread.jspa?threadID=334609

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.