Manage your personal desktop session collections

Use the following information to manage a personal desktop session collection in Remote Desktop Services.

Manually assign a user to a personal session host

Use the Set-RDPersonalSessionDesktopAssignment cmdlet to manually assign a user to a personal session host server in the collection. The cmdlet supports the following parameters:

-CollectionName <string>

-ConnectionBroker <string>

-User <string>

-Name <string>

  • –CollectionName - specifies the name of the personal session desktop collection. This parameter is required.
  • –ConnectionBroker - specifies the Remote Desktop Connection Broker (RD Connection Broker) server for your Remote Desktop deployment. If you don't supply a value, the cmdlet uses the fully qualified domain name (FQDN) of the local computer.
  • –User - specifies the user account to associate with the personal session desktop, in DOMAIN\User format. This parameter is required.
  • –Name - specifies the name of the session host server. This parameter is required. The session host identified here must be a member of the collection that the -CollectionName parameter specifies.

The Import-RDPersonalSessionDesktopAssignment cmdlet imports associations between user accounts and personal session desktops from a text file. The cmdlet supports the following parameters:

-CollectionName <string>

-ConnectionBroker <string>

-Path <string>

–Path specifies the path and file name of a file to import.

Removing a User Assignment from a Personal Session Host

Use the Remove-RDPersonalSessionDesktopAssignment cmdlet to remove the association between a personal session desktop and a user. The cmdlet supports the following parameters:

-CollectionName <string>

-ConnectionBroker <string>

-Force

-Name <string>

-User <string>

–Force forces the command to run without asking for user confirmation.

Query user assignments

Use the Get-RDPersonalSessionDesktopAssignment cmdlet to get a list of personal session desktops and associated user accounts. The cmdlet supports the following parameters:

-CollectionName <string>

-ConnectionBroker <string>

-User <string>

-Name <string>

You can run the cmdlet to query by collection name, user name, or by session desktop name. If you specify only the –CollectionName parameter, the cmdlet returns a list of session hosts and associated users. If you also specify the –User parameter, the session host associated with that user is returned. If you provide the –Name parameter, the user associated with that session host is returned.

The Export-RDPersonalPersonalDesktopAssignment cmdlet exports the current associations between users and personal virtual desktops to a text file. The cmdlet supports the following parameters:

-CollectionName <string>

-ConnectionBroker <string>

-Path <string>

All new cmdlets support the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.