PowerShell Logo Small

New-WSManSessionOption



This is the built-in help made by Microsoft for the command 'New-WSManSessionOption', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Creates a WS-Management session option hash table to use as input parameters to the following WS-Management cmdlets: Get-WSManInstance Set-WSManInstance Invoke-WSManAction Connect-WSMan

SYNTAX


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



Search powershellhelp.space

DESCRIPTION


Creates a WSMan Session option hashtable which can be passed into WSMan cmdlets:


Get-WSManInstance


Set-WSManInstance


Invoke-WSManAction


Connect-WSMan



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=141449
Connect-WSMan
Disable-WSManCredSSP
Disconnect-WSMan
Enable-WSManCredSSP
Get-WSManCredSSP
Get-WSManInstance
Invoke-WSManAction
New-WSManInstance
Remove-WSManInstance
Set-WSManInstance
Set-WSManQuickConfig
Test-WSMan

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\> $a = New-WSManSessionOption -operationtimeout 30000
Connect-WSMan -computer server01 -sessionoption $a
PS C:\Users\testuser> cd wsman:
PS WSMan:\>
PS WSMan:\> dir
WSManConfig: Microsoft.WSMan.Management\WSMan::WSMan
ComputerName Type
------------ ----
localhost Container
server01 Container



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

The first command uses the New-WSManSessionOption cmdlet 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.

The Connect-WSMan cmdlet is generally used within 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 will appear in the ComputerName list.