Enable-PSSessionConfiguration
Enables the session configurations on the local computer.
Enable-PSSessionConfiguration [[-Name] [<String[]>]] [-Force] [-NoServiceRestart] [-SecurityDescriptorSddl[<String>]] [-SkipNetworkProfileCheck] [-Confirm] [-WhatIf] [<CommonParameters>]
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:
PlugIn 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>]
|
-Name [<String[]>]
|
-NoServiceRestart [<SwitchParameter>]
|
-SecurityDescriptorSddl [<String>]
|
-SkipNetworkProfileCheck [<SwitchParameter>]
|
-Confirm [<SwitchParameter>]
|
-WhatIf [<SwitchParameter>]
|
<CommonParameters>
|
Inputs
Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration, System.String
You can pipe a session configuration object or a string that contains the name of a session configuration to this cmdlet.
Outputs
None
This cmdlet does not return any objects.
Examples
- Re-enable the default session:
PS C:> Enable-PSSessionConfiguration
This command re-enables the Microsoft.PowerShell default session configuration on the computer.
- Re-enable specified sessions:
PS C:> Enable-PSSessionConfiguration -Name MaintenanceShell, AdminShell
This command re-enables the MaintenanceShell and AdminShell session configurations on the computer.
- Re-enable the all sessions:
PS C:> Enable-PSSessionConfiguration -Name * PS C:> Get-PSSessionConfiguration | Enable-PSSessionConfiguration
These commands re-enable all session configurations on the computer. The commands are equivalent. Therefore, you can use either.
Enable-PSSessionConfiguration does not generate an error if you enable a session configuration that is already enabled.
- Re-enable a session and specify a new security descriptor:
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"
This command re-enables the MaintenanceShell session configuration and specifies a new security descriptor for the configuration.
Additional Notes
To run this cmdlet on Windows Vista, Windows Server 2008, and later versions of the Windows operating system, you must start Windows PowerShell by using the Run as administrator option.
Related Links
Disable-PSSessionConfiguration
Get-PSSessionConfiguration
New-PSSessionConfigurationFile
New-PSSessionOption
Register-PSSessionConfiguration
Set-PSSessionConfiguration
Test-PSSessionConfigurationFile
Unregister-PSSessionConfiguration