Post

Reset XenDesktop VM Name Count

Reset XenDesktop VM Name Count

Resetting VM Naming Sequence in XenDesktop

Important Note: For these commands to work, they must be executed via the PowerShell console in Citrix Studio. The standard PowerShell interface won’t have access to the required Citrix cmdlets.

Checking Current Identity Pool Settings

First, check the current state of your identity pool to see the naming scheme and current count:

1
2
# View identity pool details
Get-AcctIdentityPool

Example output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
AvailableAccounts : 0
Domain           : VGPU.demo
ErrorAccounts    : 0
IdentityPoolName : Win7
IdentityPoolUid  : c00bf2a9-3cca-46bd-b24a-0edfa25d1372
InUseAccounts    : 4
Lock             : False
MetadataMap      : {}
NamingScheme     : Win7-0#
NamingSchemeType : Numeric
OU               : 
StartCount       : 5
TaintedAccounts  : 0
Scopes           :

Resetting the VM Name Counter

To reset the VM naming sequence to start from a lower number (for example, from 1 instead of 5):

1
2
# Create a new AD account with a specific starting count
New-AcctADAccount -IdentityPoolName "Win7" -Count 1 -StartCount 1

This command creates a new account in the identity pool named “Win7” and sets the counter to start from 1.

Understanding the Parameters

  • IdentityPoolName: The name of the identity pool to modify
  • Count: The number of accounts to create
  • StartCount: The number to start counting from for the new accounts

Additional Useful Commands

Modify an Existing Identity Pool

1
2
# Change the naming scheme or other properties
Set-AcctIdentityPool -IdentityPoolName "Win7" -NamingScheme "Win10-##" -NamingSchemeType "Numeric"

Remove Unused AD Accounts

1
2
# Remove accounts that are not in use
Remove-AcctADAccount -IdentityPoolName "Win7" -ADAccountName "VGPU\Win7-05"

Get Details About Specific AD Accounts

1
2
# Get information about accounts in the pool
Get-AcctADAccount -IdentityPoolName "Win7"

Troubleshooting

If you encounter errors when creating new accounts with a lower start count:

  1. Check if accounts with those names already exist in Active Directory
  2. Verify you have sufficient permissions in both Citrix and Active Directory
  3. Ensure the naming scheme allows for the numbering pattern you’re trying to use
This post is licensed under CC BY 4.0 by the author.