Skip to main content

Set-AdcRemotingConfig

SYNOPSIS

Define the connection settings to use for PS remoting connections to the target.

SYNTAX

__AllParameterSets

Set-AdcRemotingConfig [-Target] <string> [[-Parameters] <hashtable>]
[[-SessionOption] <PSSessionOption>] [[-SshUserName] <string>] [[-SshKeyFilePath] <string>]
[[-SshSubsystem] <string>] [[-SshOption] <hashtable>] [-UseSSH] [-SshTransport]
[<CommonParameters>]

DESCRIPTION

Define the connection settings to use for PS remoting connections to the target. Target can be any specific host, domain or subdomain.

For example, assuming these three targets have settings defined:

  • contoso.com
  • corp.contoso.com
  • dc1.corp.contoso.com

In this case, the most specific target wins:

  • dc1.corp.contoso.com will select the "dc1.corp.contoso.com" config.
  • dc2.corp.contoso.com will select the "corp.contoso.com" config.
  • dc1.sales.contoso.com will select the "contoso.com" config.

EXAMPLES

EXAMPLE 1

Set-AdcRemotingConfig -Target contoso.com -SessionOption $option

Have all remoting connections to DCs in contoso.com use the specified options.

EXAMPLE 2

Set-AdcRemotingConfig -Target dc1.contoso.com -UseSSH

Have all remoting connections to DC dc1.contoso.com use SSH.

PARAMETERS

-Parameters

Parameters to use when establishing the connection. Each key in the hashtable must map to a parameter on "New-PSSession". Note: There are different parameters between PowerShell v5.1 and v7+.

Type: System.Collections.Hashtable
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SessionOption

A PowerShell session option item to apply. This allows enabling proxy settings and other connection metadata.

Type: System.Management.Automation.Remoting.PSSessionOption
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SshKeyFilePath

The path to the key file for authenticating via SSH.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 4
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SshOption

The SSH options to include.

Type: System.Collections.Hashtable
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 6
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SshSubsystem

The Subsystem in the SSH server.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 5
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SshTransport

Whether to use SSH transport.

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SshUserName

The user name to use with SSH sessions.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Target

The target the configuration applies to.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-UseSSH

Use SSH for the remoting connection. Redundant if used with other SSH parameters.

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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.