Edit

Share via


Remove-RDPersonalVirtualDesktopAssignment

Removes the association between a personal virtual desktop and a user.

Syntax

RemoveByUser (Default)

Remove-RDPersonalVirtualDesktopAssignment
    [-CollectionName] <String>
    [-User] <String>
    [-ConnectionBroker <String>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RemoveByDesktop

Remove-RDPersonalVirtualDesktopAssignment
    [-CollectionName] <String>
    [-VirtualDesktopName] <String>
    [-ConnectionBroker <String>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-RDPersonalVirtualDesktopAssignment cmdlet removes an existing association between a personal virtual desktop and a user. This removal makes the virtual desktop available for another user.

Examples

Example 1: Remove a personal virtual desktop assignment by user

PS C:\>Remove-RDPersonalVirtualDesktopAssignment -CollectionName "Virtual Desktop Collection" -User "CONTOSO\sarahjones"

This command removes a personal virtual desktop assignment by user.

Example 2: Remove a personal virtual desktop assignment virtual desktop name

PS C:\>Remove-RDPersonalVirtualDesktopAssignment -CollectionName "Virtual Desktop Collection" -VirtualDesktopName "PVD-12"

This command removes a personal virtual desktop assignment by virtual desktop name.

Parameters

-CollectionName

Specifies the name of a personal virtual desktop collection.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ConnectionBroker

Specifies the Remote Desktop Connection Broker (RD Connection Broker) server for a Remote Desktop deployment. If you do not supply a value, the cmdlet uses the fully qualified domain name (FQDN) of the local computer.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-User

Specifies the user account to remove, in DOMAIN\User format.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveByUser
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-VirtualDesktopName

Specifies the name of the virtual desktop. This parameter is required. The virtual desktop identified here must be a member of the collection that the CollectionName parameter specifies.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveByDesktop
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

Object