PowerShell Script to Uninstall all Versions of Citrix Client and Install Citrix Receiver 3.x

This script will uninstall ALL versions of Citrix online plugin AND Receiver and then install Citrix Receiver, it should work for any version of Receiver but I wrote it for 3.4.
The script should work on Windows XP, Windows Vista, Windows 7, Windows 8, Windows 2003, Windows 2008, and Windows 2008 R2 but I haven’t tested it on all so let me know if you get an issues.

It first kills the processes that can prevent uninstall and then at the end it checks that PnSson is in the network binding provider order as I have been having problems with this and it stops single sign on working.

Under the ##InstallReceiver section you need to edit

$InstallFiles= Enter the full path to the CitrixReceiverEnterprise.exe. N.B This path needs to be in your I.E Local intranet sites to prevent a Open File – Security Warning appearing
$ArgumentList= Add or remove all your required features including updating SERVER_LOCATION with the path to your services site. I have included the options I use

See eDocs for the command line install options

#*FileName: Citrix_Client_Uninstall_and_Install.ps1

#*Created 10/05/2013
#*Author: Shaun Ritchie

##Kill Citrix Client Processses that prevent uninstall

Stop-Process -ProcessName wfcrun32 -force
Stop-Process -ProcessName ssonsvr -force

##Uninstall old clients that use GUIDs, 11.000 and below


ForEach ($Guid in $Guids)
$ArgumentList = “/x” + “{” + $Guid + “}” + ” /qn REBOOT=ReallySuppress /quiet”
Start-Process -FilePath msiexec.exe -ArgumentList $ArgumentList -wait

##Get the correct location of install directory

$OSVersionNo = [System.Environment]::OSVersion.Version

##Windows XP and Windows Server 2003
If (($OSVersionNo.Build -eq 2600) -or ($OSVersionNo.Build -eq 3790))

$InstallLocation=$env:AllUsersProfile + “Application Data”



##Uninstall clients 11.2 and above

$InstallDirs = “`”$InstallLocationCitrixCitrix online plug-inTrolleyExpress.exe`””, “`”$InstallLocationCitrixCitrix online plug-in – webTrolleyExpress.exe`””

foreach ($InstallDir in $InstallDirs)

Start-Process -FilePath $InstallDir -ArgumentList “/uninstall /cleanup /silent” -wait

##Uninstall all versions of Receiver

$InstallDir = $InstallLocation + “CitrixCitrix Receiver (Enterprise)TrolleyExpress.exe”

Start-Process -FilePath $InstallDir -ArgumentList “/uninstall /cleanup /silent” -wait

##Install Receiver

$InstallFiles = “”
$ArgumentList = ‘/noreboot /silent /includeSSON ADDLOCAL=”ReceiverInside,ICA_Client,PN_Agent,SSON,USB,DesktopViewer,Flash,Vd3d” Enable_SSON=”Yes” Enable_KERBEROS=”No” LEGACYFTAICONS=”True” Enable_DYNAMIC_CLIENT_NAME=”Yes” ENABLEPRELAUNCH=”True” SERVER_LOCATION=””‘

Start-Process -FilePath $InstallFiles -ArgumentList $ArgumentList -wait

##Make sure Single Sign is in Provider Order Key

$Path = “HKLM:systemCurrentControlSetControlNetworkProviderOrder”

$ProviderOrder = (Get-ItemProperty -path $path).ProviderOrder
If ($ProviderOrder -NotLike “*PnSson*”)

Set-ItemProperty -path $path -Name ProviderOrder -value ($ProviderOrder + “,PnSson”)
$NewProviderOrder = (Get-ItemProperty -path $path).ProviderOrder
Write-Host Provider Order key now has the following values $NewProviderOrder

Write-Host “PnSson already present in Provider Order”


Be the first to comment!

Join the discussion