Table of contents
ISE
TOC
Collapse the table of content
Expand the table of content

New-WSManSessionOption

JuanPablo Jofre|Last Updated: 11/17/2016
|
2 Contributors

SYNOPSIS

Creates session option hash table to use as input parameters for WS-Management cmdlets.

SYNTAX

New-WSManSessionOption [-ProxyAccessType <ProxyAccessType>] [-ProxyAuthentication <ProxyAuthentication>]
 [-ProxyCredential <PSCredential>] [-SkipCACheck] [-SkipCNCheck] [-SkipRevocationCheck] [-SPNPort <Int32>]
 [-OperationTimeout <Int32>] [-NoEncryption] [-UseUTF16] [<CommonParameters>]

DESCRIPTION

The New-WSManSessionOption cmdlet creates a WSMan Session option hash table which can be passed to WSMan cmdlets:

  • Get-WSManInstance
  • Set-WSManInstance
  • Invoke-WSManAction
  • Connect-WSMan

EXAMPLES

Example 1: Create a connection that uses connection options

PS C:\>$a = New-WSManSessionOption -OperationTimeout 30000
PS C:\> Connect-WSMan -ComputerName "server01" -SessionOption $a
PS C:\> cd wsman:
PS WSMan:\>
PS WSMan:\> dir
WSManConfig: Microsoft.WSMan.Management\WSMan::WSMan
ComputerName                                  Type
------------                                  ----
localhost                                     Container
server01                                      Container

This example creates a connection to the remote server01 computer by using the connection options that are defined by New-WSManSessionOption.

The first command uses New-WSManSessionOption to store a set of connection setting options in the $a variable. In this case, the session options set a connection time out of 30 seconds (30,000 milliseconds).

The second command uses the SessionOption parameter to pass the credentials that are stored in the $a variable to Connect-WSMan. Then, Connect-WSMan connects to the remote server01 computer by using the specified session options.

Connect-WSMan is generally used in the context of the WSMan provider to connect to a remote computer, in this case the server01 computer. However, you can use the cmdlet to establish connections to remote computers before you change to the WSMan provider. Those connections appear in the ComputerName list.

PARAMETERS

-NoEncryption

Indicates that the connection does not use encryption for remote operations over HTTP.

By default, unencrypted traffic is not enabled. It must be enabled in the local configuration.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-OperationTimeout

Specifies the time-out, in milliseconds, for the WS-Management operation.

Type: Int32
Parameter Sets: (All)
Aliases: OperationTimeoutMSec

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProxyAccessType

Specifies the mechanism by which the proxy server is located. The acceptable values for this parameter are:

  • ProxyIEConfig. Use the Internet Explorer proxy configuration for the current user.
  • ProxyWinHttpConfig. The WSMan client uses the proxy settings configured for WinHTTP, using the ProxyCfg.exe utility.
  • ProxyAutoDetect. Force auto-detection of a proxy server.
  • ProxyNoProxyServer. Do not use a proxy server. Resolve all host names locally.

The default value is ProxyIEConfig.

Type: ProxyAccessType
Parameter Sets: (All)
Aliases: 
Accepted values: ProxyIEConfig, ProxyWinHttpConfig, ProxyAutoDetect, ProxyNoProxyServer

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProxyAuthentication

Specifies the authentication method to use at the proxy. The acceptable values for this parameter are:

  • Basic. Basic is a scheme in which the user name and password are sent in clear-text to the server or proxy.
  • Digest. Digest is a challenge-response scheme that uses a server-specified data string for the challenge.
  • Negotiate. Negotiate is a challenge-response scheme that negotiates with the server or proxy to determine which scheme to use for authentication. Examples are the Kerberos protocol and NTLM.

The default value is Negotiate.

Type: ProxyAuthentication
Parameter Sets: (All)
Aliases: 
Accepted values: Negotiate, Basic, Digest

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProxyCredential

Specifies a user account that has permission to gain access through an intermediate Web proxy.

Type: PSCredential
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SPNPort

Specifies a port number to append to the connection Service Principal Name (SPN) of the remote server. An SPN is used when the authentication mechanism is Kerberos or Negotiate.

Type: Int32
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SkipCACheck

Specifies that, when it connects over HTTPS, the client does not validate that the server certificate is signed by a trusted certification authority (CA). Use this option only when the remote computer is trusted by another method, for example, if the remote computer is part of a network that is physically secure and isolated or the remote computer is listed as a trusted host in the WS-Management configuration.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SkipCNCheck

Specifies that the certificate common name (CN) of the server does not have to match the host name of the server. This is used only in remote operations using HTTPS. This option should only be used for trusted computers.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SkipRevocationCheck

Indicates that the connection does not validate the revocation status on the server certificate.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-UseUTF16

Indicates that the connection encodes the request in UTF16 format instead of UTF8 format. The default is UTF8 encoding.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

OUTPUTS

SessionOption

NOTES

Connect-WSMan

Disable-WSManCredSSP

Disconnect-WSMan

Enable-WSManCredSSP

Get-WSManCredSSP

Get-WSManInstance

Invoke-WSManAction

New-WSManInstance

Remove-WSManInstance

Set-WSManInstance

Set-WSManQuickConfig

Test-WSMan

© 2016 Microsoft