Tuesday, 7 April 2026

Appsense Logon Notification Timings

Appsense EM 8.5 and 8.6 now uses SysNotify for logon notification.

Notifications are processed in sequence contained in the following registry key.
The * on the end is a wildcard.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Winlogon\Notifications\Configurations\Default

In my unmodified Server 2012 environment I have the following in my list.

SessionEnv,UserProfileMan,Profiles,Dot3svc,Wlansvc,GPClient,EmPolicy,TermSrv,AUInstallAgent,*

In a more basic system you may see
Profiles,Dot3svc,Wlansvc,GPClient,EmPolicy,TermSrv,*

Personal VDisks Backup and Restore Process

Citrix have an detailed article on Managing Personal Vdisks and backing up and restoring them.
This is detailed in the E-docs here

The following shows the process used by RealServe IT in our labs to test the process.

This process is designed to help move a users Personal Vdisk to another catalog.
This could be used to migrate users to a newer environment or recover from a failure.
Essentialy the scripts attach the users personal Vdisk to another Virtual Machine.
The document says the personal Vdisk can only be moved however to a catalog with a master related to the original catalog the Vdisk started life from. This could limit the flexibilty of this process.

Vmware Powershell CLI
Download the Vmware PowerCLI tools. (eg. Vmware-PowerCLI-5.1.0-793510)
I installed this onto my DDC where i am going to run the scripts.

Citrix Scripts
I grabbed the Citrix scripts from the Xendesktop source media.
(inside \support\tools\scripts)

Certificate Error
When running the script I received a certificate error for Vcenter. Im not sure why as my VSphere client works as expected from the same box. 
I found a workaround is to ignore cert errors. To set this run the following powershell commands
ASNP VM*
Set-PowerCLIConfiguration -invalidcertificateaction ignore

Backup Script
From the DDC with the Vmware PowerCLI installed i ran the migration-backup.ps1 script.

VM not Assigned
When running the migration-backup.ps1 script I was getting an error VMs not assigned. This was correct, some of my VMs were not directly assigned to a user yet. This is just a warning.

Restore (Option 1)
Create a new catalog from the same master as the original catalog.
Assign the new catalog to the same delivery group
Put the delivery group into maintenance mode and shut-down machines
Move the Personal Vdisks as required to new storage (xxx_pvdisk.vmdk)
Edit the XML file changing "diskname" to the new storage location
Run migration-restore.ps1 , choose new Catalog, Choose storage, Choose XML file

(Note : I received an error about maintenance mode, however the process worked)
(Note : The original Catalog with PVDisks remain and can be deleted once we are happy the process has worked)
(Note : to use powershell to check no-one is assigned to the machines use the following code
     get-brokerdesktop -machinename domain\machinename







Thursday, 2 May 2024

Install Vmware Powershell Snap Ins

 You should be able to grab the VMware powershell snap-ins download from the Vmware site. 


These are just a bunch of files. 

run $env:psmodulepath to see a list of paths you can place the modules. 


Typically i use 
C:\Windows\system32\WindowsPowerShell\v1.0\Modules


Then copy these on the machine you want to run CLI into the folder. 

the import the modules required

Import-Module VMware.VimAutomation.Core










Tuesday, 6 February 2024

Citrix Information available in Session (NameSpace)

 




We can use Namespace Info to get some information on a VM

This can be handy for getting some awareness within windows. 



gwmi -Namespace root\citrix\desktopinformation -class Citrix_VirtualDesktopInfo


  • This will shows
  • Site Name
  • Catalog Name
  • Delivery Group Name

Wednesday, 31 January 2024

Windows Server loses Domain Trust - Aka falls out Domain - Repair it with script from ControlUp

 I have often seen server and workstations fall out of the domain.

Detecting this is hard and i will post back if i find something. 


But fixing can either be done manually or via script. 


I see Controlup providied a script. 

Shame is i dont think you will be about to remote execute it due to the nature of the issue.


Anyway check out the script

https://www.controlup.com/script-library-posts/repair-machine-domain-trust-relationship/



Wednesday, 20 December 2023

Citrix Release Years

 After preparing for an interview i was thinking about how long i have been working on Citrix products. 

So to be sure i asked ChatGPT for release years. It didnt do a very good job, so heres a tidy list.

the short answer though for me is 20+ years oif experience.



Citrix Metaframe XP  - Released 2002

Presentation Server - Released 2005

XenApp 6 -  Released 2010

XenApp 6.5  - Released 2012

Xendesktop  - Released 2013

CVAD - Released 2018


Friday, 18 November 2022

Powershell Sleep with GUI feedback - Powershell Sleep Feedback timer

 We often need pauses or sleep in our powershell scripts. 

However it can be annoying not to know where the sleep or pause is at. 

The following function gives a visual GUI feedback of the sleep in the script


Example here  (30 seconds remaining)



To acheive this add this function to your script, and call it with the command

sleep-progress 30      



Function Sleep-Progress($seconds) {
$s = 0;
Do {
$p = [math]::Round(100 - (($seconds - $s) / $seconds * 100));
Write-Progress -Activity "Waiting..." -Status "$p% Complete:" -SecondsRemaining ($seconds - $s) -PercentComplete $p;
[System.Threading.Thread]::Sleep(1000)
$s++;
}
While($s -lt $seconds);

}

PowerShell window pauses running code due to focus change

 PowerShell window pauses due to focus change - This is very annoying if your running log scripts on your daily machine , as you want to minimise powershell and expect it to crack on, but it often pauses and needs you to hit a key for it to continue. 

you almost get dragged back to the 1980s  "Press any key to continue" memorys

How to resolve it

Remove " Quickedit Mode" 

Remove "Insert Mode"

I know these are very handy features to have on. BUT these need to be disabled to make the window reliable. 







Friday, 9 September 2022

 Rebuild WMI 

We have sometimes found the WMI classes are blank or corrupt.


The following steps can rebuild your WMI


Disable and stop WinMgmt service

rename C:\windows\system32\wbem\repository

Enable the WinMgmt Service

change path to c:\windows\system32\wbem

run for /f %s in ('dir /b *.mof) do mofcomp %s

run for /f %s in ('dir /b en-us\*.mfl') do mofcomp en-us\%s




Monday, 25 March 2019

Xendesktop power State unknown - Vmware Xendesktop UUID GUI Mismatch

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 Command to View Hosted Connection GUID
$Data = get-vm $Machinename | get-view
$DataConfig = $data.vmware.vim.virtualmachineconfiginfo
$GUID = $DataConfig.Config.uuid


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