Friday, April 29, 2016

Change VLAN assigned to a Citrix XenDesktop/XenApp 7.x Hosting Resource

I created a hosting resource in Citrix Studio, then needed to change the VLAN I associated with it. This apparently can't be done from within Studio, but can be done with a PowerShell command. Here is what I did to change the assigned VLAN:

First, I created a new resource with the correct network VLAN so I could have it for reference.

From the Citrix Delivery Controller server, I ran PowerShell as Administrator, then typed the following commands:

Add-PSSnapin *Citrix*
Get-Item 'XDHyp:\HostingUnits\NAMEOFCORRECTRESOURCE'

This gave me information about the new, correct resource I created. I copied the value of the "NetworkPath" for the resource, then ran the following command on the resource I wanted to change:

Set-Item 'XDHyp:\HostingUnits\NAMEOFRESOURCE' -NetworkPath 'PASTEPATHHERE'

That's all I had to do! New VMs created using that resource are now using the new VLAN.