Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Enable-PSSessionConfiguration

Enable-PSSessionConfiguration

system.management.automation.dll

Synopsis

Enables the session configurations on the local computer.

Syntax

Enable-PSSessionConfiguration [-Name] [-Force] [-SecurityDescriptorSddl] [-SkipNetworkProfileCheck] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

The Enable-PSSessionConfiguration cmdlet enables registered session configurations that have been disabled, such as by using the Disable-PSSessionConfiguration or Disable-PSRemoting cmdlets, or the AccessMode parameter of Register-PSSessionConfiguration. This is an advanced cmdlet that is designed to be used by system administrators to manage customized session configurations for their users.

Without parameters, Enable-PSSessionConfiguration enables the Microsoft.PowerShell configuration, which is the default configuration that is used for sessions.

Enable-PSSessionConfiguration removes the "Deny_All" setting from the security descriptor of the affected session configurations, turns on the listener that accepts requests on any IP address, and restarts the WinRM service. Beginning in Windows PowerShell 3.0, Enable-PSSessionConfiguration also sets the value of the Enabled property of the session configuration (WSMan:\<computer>\PlugIn\<SessionConfigurationName>\Enabled) to "True". However, Enable-PSSessionConfiguration does not remove or change the "Network_Deny_All" (AccessMode=Local) security descriptor setting that allows only users of the local computer to use to the session configuration.

The Enable-PSSessionConfiguration cmdlet calls the Set-WSManQuickConfig cmdlet. However, it should not be used to enable remoting on the computer. Instead, use the more comprehensive cmdlet, Enable-PSRemoting.

Parameters

-Force <SwitchParameter>

Suppresses all user prompts, and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.

To prevent a restart and suppress the restart prompt, use the NoServiceRestart parameter.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Name <String[]>

Specifies the names of session configurations to enable. Enter one or more configuration names. Wildcards are permitted.

You can also pipe a string that contains a configuration name or a session configuration object to Enable-PSSessionConfiguration.

If you omit this parameter, Enable-PSSessionConfiguration enables the Microsoft.PowerShell session configuration.

Aliases

None

Required?

false

Position

1

Default value

None

Accept pipeline input?

true (ByValue, ByPropertyName)

Accept wildcard characters?

true

-SecurityDescriptorSddl <String>

Replaces the security descriptor on the session configuration with the specified security descriptor.

If you omit this parameter, Enable-PSSessionConfiguration just deletes the "deny all" item from the security descriptor.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-SkipNetworkProfileCheck <SwitchParameter>

Enables the session configuration when the computer is on a public network. This parameter enables a firewall rule for public networks that allows remote access only from computers in the same local subnet. By default, Enable-PSSessionConfiguration fails on a public network.

This parameter is designed for client versions of Windows. Server versions of Windows have a local subnet firewall rule for public networks by default. However, if the local subnet firewall rule is disabled on a server version of Windows, this parameter re-enables it.

To remove the local subnet restriction and enable remote access from all locations on public networks, use the Set-NetFirewallRule cmdlet in the NetSecurity module. For more information, see Enable-PSRemoting.

This parameter is introduced in Windows PowerShell 3.0.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Confirm <SwitchParameter>

Prompts you for confirmation before running the cmdlet.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

-WhatIf <SwitchParameter>

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type

Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration, System.String

Return Type

None

Notes

To run this cmdlet on Windows Vista, Windows Server 2008, and later versions of Windows, you must start Windows PowerShell with the "Run as administrator" option.

Examples

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

This command re-enables the Microsoft.PowerShell default session configuration on the computer.

PS C:\>Enable-PSSessionConfiguration

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

This command re-enables the MaintenanceShell and AdminShell session configurations on the computer.

PS C:\>Enable-PSSessionConfiguration -name MaintenanceShell, AdminShell

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

These commands re-enable all session configurations on the computer. The commands are equivalent, so you can use either one.

Enable-PSSessionConfiguration does not generate an error if you enable a session configuration that is already enabled.

PS C:\>Enable-PSSessionConfiguration -name *
PS C:\>Get-PSSessionConfiguration | Enable-PSSessionConfiguration

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

This command re-enables the MaintenanceShell session configuration and specifies a new security descriptor for the configuration.

PS C:\>Enable-PSSessionConfiguration -name MaintenanceShell -securityDescriptorSDDL "O:NSG:BAD:P(A;;GXGWGR;;;BA)(A;;GAGR;;;S-1-5-21-123456789-188441444-3100496)S:P"

Online Version
Disable-PSSessionConfiguration
Enable-PSSessionConfiguration
Get-PSSessionConfiguration
New-PSSessionConfigurationFile
New-PSSessionOption
Register-PSSessionConfiguration
Set-PSSessionConfiguration
Test-PSSessionConfigurationFile
Unregister-PSSessionConfiguration
WSMan Provider
about_Session_Configurations
about_Session_Configuration_Files