Thursday, January 21, 2016

Old school installer architecture selection script.

Some days you need to write a script that takes action based on whether you are installing on a x32 or x64 box.  Here is a simple VBscript that just works...

Set WshShell = WScript.CreateObject("WScript.Shell")

OSbits = WshShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")

If OSbits = "x86"
WshShell.Run "msiexec.exe /qn /i install_x86.msi /norestart"
WshShell.Run "msiexec.exe /qn /i install_x64.msi /norestart"
End If

Wednesday, January 6, 2016

Adding space to a Citrix Provisioning Services Vdisk without reverse imaging.

In the course of patching and modification a Citrix Provisioning Services disk image can sometimes exceed it's original storage capacity. Like a normal virtual machine, a PVS image can be extended to increase its useful life. As this is executed against an umnounted, unused PVS image the risk is minimal. Failback is to create a clean image from the current gold image.


Prior to attempting to extend a Vdisk ensure that it is not locked, in use or mounted in PVS (the lock icon indicates whether it is locked or not and if it is in use the Connections will be greater than 0).


Open an command prompt and issue the Diskpart Command (on some systems escalation is required).:

Mount Vdisk

 Select the Vdisk to modify and attach it to Diskpart:

Increase Size

Increase the maximum size of the VDisk (Size is in Megabytes):

Attach to the Vdisk

Attach the vdisk and determine the correct volume to extend:

Select the volume

Select the volume to extend and execute the extend command:


Review your results:


Clean up and exit:


Command Cheat sheet

You must be an administrator to take these actions. Begin with a command prompt.

Select vdisk file="<PATH>\<VDISKFILE>.vhd" 
list vdisk
expand vdisk maximum=62000
attach vdisk
list disk
list volume
select volume 7
list volume
detach vdisk

Tuesday, January 5, 2016

Powershell One Liners for Xenapp 6.5

I am preparing a report and I needed some stats about a large 6.5 XenApp environment.  Powershell and ASNP Citrix* to the rescue.

Count of Applications


Count of Disabled Applicarions

Get-XAApplication|where{$_.enabled -eq $false}|measure

Count of Apps granted to "domain users"

Get-XAApplication|Get-XAAccount|where{$_.accountname -contains "domain users"}|measure

Happy counting...