Monday, 25 March 2019

Xendesktop power State unknown

A POWER STATE UNKNOWN is quite likely to be produced in the event of change to VMs on the hyper-visor that breaks its connection with Xendesktop. This commonly occurs with a VM GUID change.

You need to ensure that the Xendesktop GUID for VMs matches the Hyper-V or Vmware GUID.

Vmware View GUIDs on Host Machine
get-childitem -path xdhyp:\hostingunits\hostservername -recurse | select -property name,id | Export-csv C:\host.csv

Xendesktop view GUID
Get-brokermachine -machinename uk\machinename | select Name,Hostedmachineid


If they are out sync, then you will need to set the GUID In Xendesktop to match the hypervisor with the following command

set-brokermachine -machinename domain\computername  -hostedmachineid xxx-yyyy-zzzz


Note : If the command to get the ID from Vmware fails, it can also be gained by changing directory to cd XDHYP:\connections\hypervisorname  then dir *.vm >out.txt and check inside the output for the machines ID









Tuesday, 19 March 2019

Batch File Loop X times

Run a Batch command X times

This will loop 100 times. Start at 1, count in 1's until you get to 100.

for /l %%x in (1, 1, 100) do (
do this
do that
)

Wednesday, 13 March 2019

Citrix Xendesktop LHC v Connection Leasing - Xendesktop 7.15 Upgrades

Local Host Cache

XA 7.9 onwards support Local host Cache Mode. This is an improvement over connection leasing. However only new installs perform the switch over. 

To disable connection leasing and enable LHC perform the following command on a controller In each site. 

Set-BrokerSite -LocalHostCacheEnabled $true -ConnectionLeasingEnabled $false

Citrix Xendesktop test SQL database failure - DR Test

To simulate a loss of the database connection perform the following.

LHC should allow the environment to continue.

HKLM\Software\Citrix\DesktopServer\LHC\OutageModeForced  Set to 1.

Friday, 22 February 2019

Compare AD group Computers and XD Computers

I wanted to check an managment AD group contained all the servers from my XD site.

Get AD Group members
get-adgroupmember "group name" | ft name,objectguid | out-file C:\temp\servers.csv

Get XD Server List
get-brokermachine | where-object {$_.desktopgroupname -eq "DGname"} | ft machinename | out-file c:\temp\XDservers.csv

Then some playing in excel to match the data.

Wednesday, 30 January 2019

Citrix Upgrade Workflow

The following is a handy workflow for the Citrix Workflow upgrade.


Thursday, 12 July 2018

Use VBS to remote execute powershell on a device (even if remote powershell is disabled)

Sometimes you will want to execute some powershell script on a machine , but most IT systems now block remote powershell as its to big a security risk. Also the normal IPC$ are also often disabled which stops our old favourite PSEXEC from working.

I found this VBS WMI call does however seem to work in this circumatnaces. It basically lets you do a remote call to powershell.exe and pipe a path to the powershell PS1 file you want to execute.

Eg.

Strcomputername = "remote computer name"
ScommandLine = "powershell.exe C:\temp\myscript.ps1"

set objWMIService = GetObject("winmgmts:{impersonationlevel=impersonate}!\\ & StrComputername & "\root\CIMV2:Win32_Process)

oError = ObjWMIService.Create(ScommandLine, null, null, iProcessID)


Friday, 17 February 2017

Smart Mirror Sales

On a slight different subject to normal I have launched a Smart Mirror product on my website www.MySmartMirror.co.uk 

This product runs an android based app to display handy information to users.
This is displayed thru a standard looking mirror frame allowing you to blend the tech with your decor.

Thursday, 30 June 2016

Citrix Session reliability screenshot of the user experience

The Citrix Session reliability feature has been around for ages. It has changed its behavior a bit recently dependent on Citrix Receiver Version. The following show the differences for the end-user experience. Thanks to Kaleigh at Citrix for her help with this.


Citrix Receiver 3.4 - This shows a reconnecting systray bubble. 
Citrix Receiver 3.4

 Citrix Receiver 4.0 thru 4.2 - This shows a systray bubble and grey's the window to show its not active

Citrix Receiver 4.0


Citrix Receiver 4.3 & 4.4 This shows a systray bubble with newer logo and connection interrupted message. The window goes grey the window to show its not active
Citrix Receiver 4.3




Tuesday, 7 June 2016

Citrix ICA file behaviour (some of it)

When connecting to a Citrix environment the connection between end-point and resource is established via an ICA file. (receiver for web)

The ICA file is generated by storefront and delivered back to the end-point.

ICA file Location
The ICA file get stored in the users
"%Appdata%\local\Temp" or "%LocalAppData%\Local\Citrix\Web Helper\Temp\2"

ICA files downloaded 
IE downloads - 4 ICA files
Chrome downloads - 2 ICA files
Firefox - 4 ICA Files
(Note : 4 files are downloaded for desktops and 2 for published applications)

File Assocation
The ICA file is then launched via file Association to open Citrix Receiver or Citrix Connection Manager.

File Delete
When the session is disconnected or logged off the ICA file should be deleted. This is contolled via the Default.ICA file on storefront with the setting RemoveICAfile=Yes

Testing
My testing showed that Firefox did not always clean up the ICA files on logoff or disconnect and left 1 ICA file behind. This was always true when "Connection Manager" was used to open ICA files. When Receiver was used within Firefox the ICA files removed as expected.
It was noticed that ICA files are always called ICAxxxx except in firefox with connection manager which names the files WEQ3xxxxx