Changing the Published Name of a Citrix XenDesktop Private Desktop

Recently a customer had a need to change the Published Name property of a Private Desktop in Citrix XenDesktop. By default, the Published Name property is Null. This article will show you some tidbits I picked up and two lines of PowerShell you can use to change the published name property of either all or a subset of private desktops.

What is a Private Desktop? Citrix explains it this way:

Private desktops are automatically created when a machine is added to a desktop group with a DesktopKind of ‘Private’, and these inherit default properties.

For this article, I created two Machine Catalogs each with three persistent machines with changes saved on the local disk as shown in Figure 1.

Figure 1

Figure 1

I also created two Delivery Groups as shown in Figure 2.

Figure 2

Figure 2

Some people believe that published private desktops use the Delivery Group’s name as the name the user sees in StoreFront and Receiver but that is not always the case. If no user assignment has been made, published private desktops, by default, use the Display name value from the Desktop Assignment Rule in StoreFront and Receiver as shown in Figures 3, 4, and 5.

Figure 3

Figure 3

Figure 4

Figure 4

Figure 5

Figure 5

As you can see from Figure 5, the Delivery Group’s name is NOT used in StoreFront and it is also not used in Receiver. Why? Because no user assignment has been made, as shown in Figures 6 and 7.

Figure 6

Figure 6

Figure 7

Figure 7

If a user assignment has been made (Figure 8), then the Delivery Group’s Published Name property value is used in StoreFront and Receiver (Figure 9).

Figure 8

Figure 8

Figure 9

Figure 9

Where did the Delivery Group’s Published Name value come from?

When you create a Delivery Group, the Published Name property gets its initial value from the Delivery Group’s Name property. If you later rename the Delivery Group, the Published Name property’s value is not changed. You can set the Delivery Group’s Published Name value to whatever value you want using the Set-BrokerDesktopGroup cmdlet.

Back to the Private Desktop name shown in StoreFront and Receiver.

If you just want the desktop’s name to show or if you allow users to use more than one desktop in a Delivery Group, then you can change the Published Name value using the Set-BrokerPrivateDesktop cmdlet.

If you have more than one Delivery Group with Private Desktops and only want this change made to a single Delivery group, that is very simple.

For this article, I only want one Delivery Group changed. One Delivery Group uses the naming scheme Persistent-## and the other uses testp-##. I want the testp desktops changed.

First, I will get all the private desktops showing only the DNSName, HostedMachineName, MachineName, and PublishedName properties as shown in Figure 10.

Get-BrokerPrivateDesktop | select dnsname,hostedmachinename,machinename,publishedname
Figure 10

Figure 10

This shows that none of the private desktops have a value for PublishedName.

Note: I removed the desktop assignment I made earlier.

If I launch all three desktops from StoreFront, Sign out from the desktop, and rerun the previous cmdlet, we get what is shown in Figure 11.

Figure 11

Figure 11

My experience is that even if I change the Published Name property’s value BEFORE I first launch a desktop, the Assignment Rule’s Display Name value is written in for the value of the private desktop’s Published Name.

I found I had to launch the private desktop FIRST and then I could change the Publish Name property.

To change the Published Name property, use the following two lines of PowerShell code as shown in Figure 12.

Note: To change the Published Name property for all private desktops, use $Pattern = “*”

$Pattern = "testp*"
$Desktops = Get-BrokerPrivateDesktop -filter {HostedMachineName -like $Pattern} ; ForEach($Desktop in $Desktops) {Set-BrokerPrivateDesktop -MachineName $Desktop.MachineName -PublishedName $Desktop.HostedMachineName}
Figure 12

Figure 12

After a refresh of StoreFront, we get what is shown in Figure 13.

Figure 13

Figure 13

All the forum posts and blogs I have read on this want the Published Name property changed AFTER users have launched their private desktops. Please take note, if you changed the Published Name property BEFORE users launch their private desktop(s) for the FIRST time, the Published Name property’s value WILL get overwritten. Apparently, Citrix didn’t put in a safety check to see if the Published Name property has a value before they just blatantly overwrote whatever value was there. Bad job Citrix.

Thanks

Webster

 

About Carl Webster

Webster is a Sr. Solutions Architect for Choice Solutions, LLC and specializes in Citrix, Active Directory and Technical Documentation. Webster has been working with Citrix products for many years starting with Multi-User OS/2 in 1990.

View all posts by Carl Webster

No comments yet.

Leave a Reply