Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Using Windows Server 2012 Remote Desktop Services, I have a 'Personal Virtual Desktop Collection' with automatic user assignment enabled.

According to Microsoft "Personal virtual desktops are permanently assigned to a user account and the user logs on to the same virtual desktop each time."

Is there a way either through the Server Manager UI or PowerShell to determine which user has been assigned to which VM?

The only way I have found so far is to query the 'Remote Desktop Users' group on each VM in the collection, however that requires each VM to be powered on. There must be a better way.

share|improve this question
add comment

1 Answer

Two ways.

PowerShell Module:

From a Windows 8/Windows Server 2012 machine in PowerShell you should be able to use the Get-RDPersonalVirtualDesktopAssignment command. You can specify a connection broker to connect to with -ConnectionBroker <String>, or query by collection and user.

Active Directory:

You may be able to find the information in Active Directory if Windows Server 2012 maintains the same schema as in 2008 R2, you may be able to find it by querying users for the msTSPrimaryDesktop attribute. To search by attribute in PowerShell, on Windows 7/2008 R2 and previous versions you may need to first run Import-Module ActiveDirectory, and then execute the command:

Get-ADUser -Properties msTSPrimaryDesktop -Filter { msTSPrimaryDesktop -like "*" }

The msTSPrimaryDesktop property is used in VDI in Windows Server 2008 R2 at least, and is also accessible on certain machines via Active Directory Users and Computers (dsa.msc). I am not sure if Windows Server 2012 uses this property as a user's primary desktop may be relative to a particular collection, not global as per 2008 R2.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.