PowerShell Logo Small

Get-PSSessionConfiguration



This is the built-in help made by Microsoft for the command 'Get-PSSessionConfiguration', in PowerShell version 2 - as retrieved from Windows version 'Microsoft® Windows Vista™ Ultimate ' 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

Gets the registered session configurations on the computer.

SYNTAX


Get-PSSessionConfiguration [[-Name] <string[]>] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Get-PSSessionConfiguration cmdlet gets the session configurations that have been registered on the local computer. This is an advanced cmdlet
that is designed to be used by system administrators to manage customized session configurations for their users.

To create and register a session configuration, use the Register-PSSessionConfiguration cmdlet.



<

RELATED LINKS

Online version: http://go.microsoft.com/fwlink/?LinkID=144304
about_Session_Configurations
Disable-PSSessionConfiguration
Enable-PSSessionConfiguration
Register-PSSessionConfiguration
Set-PSSessionConfiguration
Unregister-PSSessionConfiguration
WS-Management
Provider



REMARKS

<

Examples


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

C:\PS>get-pssessionconfiguration



Description
-----------
This command gets the session configurations on the computer.








-------------------------- EXAMPLE 2 --------------------------

C:\PS>get-pssessionconfiguration -name Microsoft*

Name PSVersion StartupScript Permission
---- --------- ------------- ----------
microsoft.powershell 2.0 BUILTIN\Administrators AccessAll...
microsoft.powershell32 2.0 BUILTIN\Administrators AccessAll...



Description
-----------
This command uses the Name parameter of Get-PSSessionConfiguration to get only the session configurations with names that begin with "Microsoft".

This command gets the two default session configurations that come with Windows PowerShell.








-------------------------- EXAMPLE 3 --------------------------

C:\PS>Get-PSSessionConfiguration -name microsoft.powershell | get-member



TypeName: Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration

Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Capability NoteProperty System.Object[] Capability=System.Object[]
ExactMatch NoteProperty System.String ExactMatch=False
Filename NoteProperty System.String Filename=%windir%\system32\pwrshplugin.dll
lang NoteProperty System.String lang=en-US
Name NoteProperty System.String Name=microsoft.powershell
PSVersion NoteProperty System.String PSVersion=2.0
ResourceUri NoteProperty System.String ResourceUri=http://schemas.microsoft.com/powershell/microsoft.powershell
SDKVersion NoteProperty System.String SDKVersion=1
SecurityDescriptorSddl NoteProperty System.String SecurityDescriptorSddl=O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
SupportsOptions NoteProperty System.String SupportsOptions=true
Uri NoteProperty System.String Uri=http://schemas.microsoft.com/powershell/microsoft.powershell
xmlns NoteProperty System.String xmlns=http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration
XmlRenderingType NoteProperty System.String XmlRenderingType=text
Permission ScriptProperty System.Object Permission {get=trap { continue; }...


C:\PS> Get-PSSessionConfiguration -name microsoft.powershell | format-list -property *


Name : microsoft.powershell
Filename : %windir%\system32\pwrshplugin.dll
SDKVersion : 1
XmlRenderingType : text
lang : en-US
PSVersion : 2.0
ResourceUri : http://schemas.microsoft.com/powershell/microsoft.powershell
SupportsOptions : true
Capability : {Shell}
Uri : http://schemas.microsoft.com/powershell/microsoft.powershell
SecurityDescriptorSddl : O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
ExactMatch : False
xmlns : http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration
Permission : BUILTIN\Administrators AccessAllowed



Description
-----------
These commands examine the PSSessionConfiguration object that Get-PSSessionConfiguration returns.

The first command uses the Get-PSSessionConfiguration cmdlet to get the Microsoft.PowerShell default configuration.

The second command uses a pipeline operator (|) to send the object that Get-PSSessionConfiguration returns to the Get-Member cmdlet. The output s
hows the properties and methods of the object.

The third command sends the same object to the Format-List cmdlet. The Property parameter with a value of * (all) directs Format-List to display
all of the properties and property values of the object in a list.

The output of this command has very useful information, including the location of the .dll that implements the configuration type, the resource U
niform Resource Identifier (URI) for the endpoint that is created, and the Security Descriptor Definition Language (SDDL) for the configuration.








-------------------------- EXAMPLE 4 --------------------------

C:\PS>dir wsman:\localhost\plugin

WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Plugin

Name Type Keys
---- ---- ----
Event Forwarding Plugin Container {Name=Event Forwarding Plugin}
MaintenanceShell Container {Name=MaintenanceShell}
microsoft.powershell Container {Name=microsoft.powershell}
microsoft.powershell32 Container {Name=microsoft.powershell32}
WMI Provider Container {Name=WMI Provider}



Description
-----------
This command uses the Get-ChildItem cmdlet (alias = dir) in the WSMan: provider drive to look at the content of the Plugin node.

This is another way to look at the session configurations on the computer.

The PlugIn node contains ContainerElement objects (Microsoft.WSMan.Management.WSManConfigContainerElement) that represent the registered Windows
PowerShell session configurations, along with other plug-ins for WS-Management.








-------------------------- EXAMPLE 5 --------------------------

C:\PS>enable-wsmanCredSSP -delegate server02

C:\PS> connect-wsman server02

C:\PS> set-item wsman:\server02*\service\auth\credSSP -value $true

C:\PS> invoke-command -scriptblock {Get-PSSessionConfiguration} -computername Server02 -authentication CredSSP -credential Domain01\Admin01

Name PSVersion StartupScript Permission PSComputerName
---- --------- ------------- ---------- --------------
microsoft.powershell 2.0 BUILTIN\Administrators AccessAll... server02.corp.fabrikam.com
microsoft.powershell32 2.0 BUILTIN\Administrators AccessAll... server02.corp.fabrikam.com
MyX86Shell 2.0 c:\test\x86Shell.ps1 BUILTIN\Administrators AccessAll... server02.corp.fabrikam.com



Description
-----------
This example shows how to run a Get-PSSessionConfiguration command on a remote computer. The command requires that CredSSP delegation be enabled
in the client settings on the local computer and in the service settings on the remote computer. To run the commands in this example, you must be
a member of the Administrators group on the local computer and the remote computer.

The first command uses the Enable-WSManCredSSP cmdlet to enable CredSSP delegation from the Server01 local computer to the Server02 remote comput
er. This configures the CredSSP client setting on the local computer.

The second command uses the Connect-WSMan cmdlet to connect to the Server02 computer. This action adds a node for the Server02 computer to the WS
Man: drive on the local computer, allowing you to view and change the WS-Management settings on the Server02 computer.

The third command uses the Set-Item cmdlet to change the value of the CredSSP item in the Service node of the Server02 computer to True. This con
figures the service settings on the remote computer.

The fourth command uses the Invoke-Command cmdlet to run a Get-PSSessionConfiguration command on the Server02 computer. The command uses the Cred
ential parameter, and it uses the Authentication parameter with a value of CredSSP.








-------------------------- EXAMPLE 6 --------------------------

C:\PS>(get-PSSessionConfiguration -name CustomShell).resourceURI

http://schemas.microsoft.com/powershell/microsoft.CustomShell



Description
-----------
This command uses the Get-PSSessionConfiguration cmdlet to get the resource URI of a session configuration.

This command is useful when setting the value of the $PSSessionConfigurationName preference variable, which takes a resource URI.

The $PSSessionConfiguationName variable specifies the default configuration that is used when you create a session. This variable is set on the l
ocal computer, but it specifies a configuration on the remote computer. For more information about the $PSSessionConfiguration variable, see abou
t_Preference_Variables.