Set-RDSessionCollectionConfiguration

Set-RDSessionCollectionConfiguration

Modifies configuration options for an existing session collection.

Syntax

Parameter Set: Default
Set-RDSessionCollectionConfiguration [-CollectionName] <String> [-ActiveSessionLimitMin <Int32> ] [-AuthenticateUsingNLA <Boolean> ] [-AutomaticReconnectionEnabled <Boolean> ] [-BrokenConnectionAction <RDBrokenConnectionAction> ] [-ClientDeviceRedirectionOptions <RDClientDeviceRedirectionOptions> ] [-ClientPrinterAsDefault <Boolean> ] [-ClientPrinterRedirected <Boolean> ] [-CollectionDescription <String> ] [-ConnectionBroker <String> ] [-CustomRdpProperty <String> ] [-DisconnectedSessionLimitMin <Int32> ] [-EncryptionLevel <RDEncryptionLevel> ] [-IdleSessionLimitMin <Int32> ] [-LoadBalancing <RDSessionHostCollectionLoadBalancingInstance[]> ] [-MaxRedirectedMonitors <Int32> ] [-RDEasyPrintDriverEnabled <Boolean> ] [-SecurityLayer <RDSecurityLayer> ] [-TemporaryFoldersDeletedOnExit <Boolean> ] [-TemporaryFoldersPerSession <Boolean> ] [-UserGroup <String[]> ] [ <CommonParameters>]

Parameter Set: DisableUserProfileDisk
Set-RDSessionCollectionConfiguration [-CollectionName] <String> -DisableUserProfileDisk [-ConnectionBroker <String> ] [ <CommonParameters>]

Parameter Set: EnableUserProfileDisk
Set-RDSessionCollectionConfiguration [-CollectionName] <String> -DiskPath <String> -EnableUserProfileDisk -MaxUserProfileDiskSizeGB <Int32> [-ConnectionBroker <String> ] [-ExcludeFilePath <String[]> ] [-ExcludeFolderPath <String[]> ] [-IncludeFilePath <String[]> ] [-IncludeFolderPath <String[]> ] [ <CommonParameters>]

Detailed Description

The Set-RDSessionCollectionConfiguration cmdlet modifies configuration options for an existing session collection. A session collection consists of one or more Remote Desktop Session Host (RD Session Host) servers. Users can connect to RD Session Host servers in a session collection to run programs, save files, and use resources on those servers.

You can use the New-RDSessionCollection cmdlet to create a session collection.

Parameters

-ActiveSessionLimitMin<Int32>

Specifies the maximum time, in minutes, an active session runs. After this period, the RD Session Host server ends the session.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-AuthenticateUsingNLA<Boolean>

Indicates whether to use Network Level Authentication (NLA). If this value is $True, Remote Desktop uses NLA to authenticate a user before the user sees a logon screen.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-AutomaticReconnectionEnabled<Boolean>

Indicates whether the Remote Desktop client attempts to reconnect after a connection interruption.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-BrokenConnectionAction<RDBrokenConnectionAction>

Specifies an action for an RD Session Host server to take after a connection interruption. The acceptable values for this parameter are:

     -- None

     -- Disconnect

     -- LogOff

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ClientDeviceRedirectionOptions<RDClientDeviceRedirectionOptions>

Specifies a type of client device to be redirected to an RD Session Host server in this session collection. The acceptable values for this parameter are:

     -- 0x0000. None.

     -- 0x0001. AudioVideoPlayBack.

     -- 0x0002. AudioRecording.

     -- 0x0004. COMPort.

     -- 0x0008. PlugAndPlayDevice.

     -- 0x0010. SmartCard.

     -- 0x0020. Clipboard.

     -- 0x0040. LPTPort.

     -- 0x0080. Drive.

     -- 0x0100. TimeZone.

You can use binary-or to combine two or more values of this enum to specify multiple client device types.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ClientPrinterAsDefault<Boolean>

Indicates whether to use the client printer or server printer as the default printer. If this value is $True, use the client printer as default. If this value is $False, use the server as default.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ClientPrinterRedirected<Boolean>

Indicates whether to use client printer redirection, which routes print jobs from the Remote Desktop session to a printer attached to the client computer.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CollectionDescription<String>

Specifies a description of the session collection.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CollectionName<String>

Specifies the name of a session collection.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ConnectionBroker<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CustomRdpProperty<String>

Specifies Remote Desktop Protocol (RDP) settings to include in the .rdp files for all Windows Server 2012 RemoteApp programs and remote desktops published in this collection.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DisableUserProfileDisk

Indicates that Remote Desktop does not use a user profile to configure the session collection.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DisconnectedSessionLimitMin<Int32>

Specifies a length of time, in minutes. After client disconnection from a session for this period, the RD Session Host ends the session.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DiskPath<String>

Specifies a path for the user profile disk.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-EnableUserProfileDisk

Indicates that Remote Desktop uses a user profile disk to configure the session collection. A user profile disk stores user profile information as a separate virtual hard disk in order to persist user profile settings across a pool of virtual desktops.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EncryptionLevel<RDEncryptionLevel>

Specifies the level of data encryption used for a Remote Desktop session. The acceptable values for this parameter are:

     -- 0. Low.

     -- 1. ClientCompatible.

     -- 2. High.

     -- 3. FipsCompliant.

The default value is ClientCompatible.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ExcludeFilePath<String[]>

Specifies an array of file paths to exclude from a user profile disk. By default, Remote Desktop creates standard file and folder paths, such as Documents and Music. Use this parameter to prevent creation of specified file paths. This parameter overrides any identical values specified in the IncludeFilePath or IncludeFolderPath parameters.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ExcludeFolderPath<String[]>

Specifies an array of folder paths to exclude from a user profile disk. By default, Remote Desktop creates standard file and folder paths, such as Documents and Music. Use this parameter to prevent creation of specified folder paths. This parameter overrides any identical values specified in the IncludeFilePath or IncludeFolderPath parameters.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-IdleSessionLimitMin<Int32>

Specifies the length of time, in minutes, to wait before an RD Session Host logs off or disconnects an idle session. The BrokenConnectionAction parameter determines whether to log off or disconnect.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-IncludeFilePath<String[]>

Specifies an array of file paths to include in a user profile disk.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-IncludeFolderPath<String[]>

Specifies an array of folder paths to include in a user profile disk.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-LoadBalancing<RDSessionHostCollectionLoadBalancingInstance[]>

Specifies an array of objects that defines load balancing guidelines for the remote session collection. Each object specifies the collection name, RD Session Host server name, relative weight to use for that server, and a maximum number of sessions to allow.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaxRedirectedMonitors<Int32>

Specifies the maximum number of client monitors that an RD Session Host server can redirect to a remote session. The highest value for this parameter is 16.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MaxUserProfileDiskSizeGB<Int32>

Specifies the maximum size, in gigabytes, for a user profile disk.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-RDEasyPrintDriverEnabled<Boolean>

Specifies whether to enable the Remote Desktop Easy Print driver.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SecurityLayer<RDSecurityLayer>

Specifies which security protocol to use. The acceptable values for this parameter are:

     -- 0. RDP.

     -- 1. Negotiate.

     -- 2. SSL.

The default value is Negotiate.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-TemporaryFoldersDeletedOnExit<Boolean>

Specifies whether to delete temporary folders from the RD Session Host server for a disconnected session.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-TemporaryFoldersPerSession<Boolean>

Specifies whether to use a single folder for temporary files. If this value is $True, a single folder contains temporary files. If this value is $False, individual users have separate folders to store temporary files.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UserGroup<String[]>

Specifies an array of domain groups and users authorized to connect to the RD Session Host servers in a session collection.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Null

    None.

Notes

  • The IncludeFolderPath and IncludeFilePath parameters are mutually exclusive with the ExcludeFolderPath and ExcludeFilePath parameters.

Examples

Example 1: Disable user profile disk

This command configures a session collection to not use a user profile disk for a session collection named Session Collection 02 that has an RD Connection Broker named RDCB.Contoso.com.

PS C:\> Set-RDSessionCollectionConfiguration -CollectionName "Session Collection 02" -DisableUserProfileDisk -ConnectionBroker "RDCB.Contoso.com"

Example 2: Specify a user profile disk with included file and folder

This command configures a session collection to use a user profile disk for a session collection named Session Collection 09 that has an RD Connection Broker named RDCB.Contoso.com. The command specifies the maximum size of the user profile disk and its disk path. The command specifies a path and file to include in the user profile.

PS C:\> Set-RDSessionCollectionConfiguration -CollectionName "Session Collection 09" -EnableUserProfileDisk -MaxUserProfileDiskSizeGB 40 -DiskPath "C:\UserVHDs" -IncludeFolderPath "C:\Resources Folder" -IncludeFileFolderPath "C:\Required Text File.txt" -ConnectionBroker "RDCB.Contoso.com"

Example 3: Specify a user profile disk with excluded file and folder

This command configures a session collection to use a user profile disk for a session collection named Session Collection 19 that has an RD Connection Broker named RDCB.Contoso.com. The command specifies the maximum size of the user profile disk and its disk path. The command specifies a path and file to exclude from the user profile.

PS C:\> Set-RDSessionCollectionConfiguration -CollectionName "Session Collection 19" -EnableUserProfileDisk -MaxUserProfileDiskSizeGB 40 -DiskPath "C:\UserVHDs" -ExcludeFolderPath "C:\Local Resources Folder" -ExcludeFilePath "C:\Local Text File.txt" -ConnectionBroker "RDCD.Contoso.com"

Example 4: Configure load balancing

This example configures load balancing for a session collection named Session Collection 07 that has an RD Connection Broker server named RDCB.Contoso.com.

The first five commands use standard Windows PowerShell® syntax to create an array of objects to define load balancing guidelines, and store those guidelines in the $LoadBalanceObjectsArray variable. This example configuration uses two RD Session Host servers named RDSH-1.Contoso.com and RDSH-2.Contoso.com

The final command specifies load balancing settings for the session collection that has the name Session Collection 07 and the RD Connection Broker server named RDCB.Contoso.com. The command uses the array stored in the $LoadBalanceObjectsArray variable to specify load balancing behavior.

PS C:\> $LoadBalanceObjectsArray = New-Object System.Collections.Generic.List[Microsoft.RemoteDesktopServices.Management.RDSessionHostCollectionLoadBalancingInstance] 
PS C:\>$LoadBalanceSessionHost1 = New-Object Microsoft.RemoteDesktopServices.Management.RDSessionHostCollectionLoadBalancingInstance( "SessionHostCollection", 50, 200, "RDSH-1.Contoso.com" )
PS C:\> $LoadBalanceObjectsArray.Add($LoadBalanceSessionHost1)
PS C:\> $LoadBalanceSessionHost2 = New-Object Microsoft.RemoteDesktopServices.Management.RDSessionHostCollectionLoadBalancingInstance( "SessionHostCollection", 50, 300, "RDSH-2Contoso.com" )
PS C:\> $LoadBalanceObjectsArray.Add($LoadBalanceSessionHost2)
PS C:\> Set-RDSessionCollectionConfiguration -CollectionName "Session Collection 07" -LoadBalancing $LoadBalanceObjectsArray -ConnectionBroker "RDCB.Contoso.com"

Get-RDSessionCollectionConfiguration

Get-RDSessionCollection

New-RDSessionCollection

Remove-RDSessionCollection