A Quick Script to Change the Published Name Variable

I had a common scenario come up the other day that I decided to finally expand my horizons a bit for and write a simple script.  Many thanks to Shane for walking me through it!

Scenario: Users have multiple static VDI published to them, all in the same Delivery Group.  By default the Display Name is always what the Delivery Group says it should be… ie “Win10” or whatever you have defined.  You do not have the ability in the GUI to change this setting to make the desktops unique.  This is very common for administrators, test users, etc;

Need: Change the Display Name to be the same as the Machine Name so that the user knows what machine they are launching.


Add-PSSnapin citrix.*
$ListofVMS=get-BrokerDesktop -DesktopGroupName “YourDeliveryGroupName
ForEach($VM in $ListofVMS)
Set-BrokerPrivateDesktop -MachineName $VM.MachineName -PublishedName $NametoSet

This simple script grabs all the machines within a specific Delivery Group and writes the list of Machine Names to an array.  It then processes each one as a variable, splitting the Machine Name at the \ to remove the Domain from the name in the array.  It uses that new split Machine Name as a variable NametoSet and then uses the Set-BrokerPrivateDesktop command to change the “Published Name” to display the MachineName as per the NametoSet 🙂  Nice and easy.

, ,

One Comment

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">