Monday, March 4, 2013

Creating a new Citrix XenDesktop 6.5 catalog throws the error: “The naming scheme “DesktopName-###” is already in use”

Problem

You attempt to create a new desktop catalog but receive the following error while going through the Create Catalog wizard:

The naming scheme “DesktopName-###” is already in use

image

Solution

While there are a variety of reasons why this error would be thrown, one of the reasons is if there are orphaned entries of a previous desktop catalog still lingering in your XenDesktop database.  The chances of running into this type of situation increase if you had to use the Remove-BrokerCatalog cmdlet to remove the desktop catalog as shown in one of my previous posts:

Deleting a desktop catalog in XenDesktop 5.6 Desktop Studio throws the error: “Unable to find machine creation data for id…”
http://terenceluk.blogspot.com/2013/01/deleting-desktop-catalog-in-xendesktop.html

As this required cleaning out stale / orphaned entries in the database, I opened up a support case with Citrix and after a few back and forth with an engineer and finally escalation to another engineer, we managed to clean up the orphaned entries with the following cmdlets:

Get-AcctIdentityPool
http://support.citrix.com/static/kc/CTX127254/help/Get-AcctIdentityPool.html

Remove-AcctIdentityPool
http://support.citrix.com/static/kc/CTX127254/help/Remove-AcctIdentityPool.html

… and:

Get-AcctADAccount
http://support.citrix.com/static/kc/CTX127254/help/Get-AcctADAccount.html

Remove-AcctADAccount
http://support.citrix.com/static/kc/CTX127254/help/Remove-AcctADAccount.html

The following outlines the steps that eventually cleaned out the entries allowing us to redeploy a new desktop catalog with the same name and same naming convention for the virtual desktops.

Get-AcctADAccount & Remove-AcctADAccount

Begin by executing the following cmdlet to list the stale entires:

Get-AcctADAccount -State Tainted

image

**Note how the State is listed as Tainted in the screenshot above.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------

I noticed that even though the Lock parameter may indicate false, sometimes you would still need to execute the following cmdlet to unlock it:

Unlock-AcctIdentityPoolName “Pool Name”

image

Otherwise you’ll receive the following error:

Remove-AcctADAccount : Identity Pool is already locked.

image

There’s no harm in executing the cmdlet so I would do it just in case.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------

With the Identity Pool unlocked, proceed with using the following cmdlet to remove each entry:

Remove-AcctADAccount -IdentityPoolName “Pool Name” -ADAccountSid <AccountSID>

Repeat the cmdlet for each tainted entry and when all of them have been removed, execute:

Get-AcctADAccount -State Tainted

… to ensure there are no more tainted entries:

image

Get-AcctIdentityPool & Remove-AcctIdentityPool

The last step is to use the Get-AcctIdentityPool cmdlet to list remaining stale entry associated with the desktop catalog:

Get-AcctIdentityPool -IdentityPoolName “Pool Name”

… then the Remove-AcctIdentityPool cmdlet to remove the entry:

Remove-AcctIdentityPool -IdentityPoolName “Pool Name”

image

With the entries removed, proceed with creating a new desktop catalog with the parameters that you weren’t able to use.

No comments: