Enable-PSRemoting

Applies To: Windows PowerShell 2.0

Configures the computer to receive remote commands.

Syntax

Enable-PSRemoting [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]

Description

The Enable-PSRemoting cmdlet configures the computer to receive Windows PowerShell remote commands that are sent by using the WS-Management technology.

You need to run this command only once on each computer that will receive commands. You do not need to run it on computers that only send commands. Because the configuration activates listeners, it is prudent to run it only where it is needed.

The Enable-PSRemoting cmdlet performs the following operations:

-- Runs the Set-WSManQuickConfig cmdlet, which performs the following tasks:

----- Starts the WinRM service.

----- Sets the startup type on the WinRM service to Automatic.

----- Creates a listener to accept requests on any IP address.

----- Enables a firewall exception for WS-Management communications.

-- Enables all registered Windows PowerShell session configurations to receive instructions from a remote computer.

----- Registers the "Microsoft.PowerShell" session configuration, if it is not already registered.

----- Registers the "Microsoft.PowerShell32" session configuration on 64-bit computers, if it is not already registered.

----- Removes the "Deny Everyone" setting from the security descriptor for all the registered session configurations.

----- Restarts the WinRM service to make the preceding changes effective.

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.

Parameters

-Force

Suppresses all user prompts. By default, you are prompted to confirm each operation.

Required?

false

Position?

named

Default Value

False

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This command supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, OutBuffer, OutVariable, WarningAction, and WarningVariable. For more information, see about_CommonParameters.

Inputs and Outputs

The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns.

Inputs

None

You cannot pipe input to this cmdlet.

Outputs

System.String

Enable-PSRemoting returns strings that describe its results.

Notes

Enable-PSRemoting attempts to create a firewall exception for WS-Management communications. On server versions of Windows, it creates a firewall exception for all network locations. On client versions of Windows, it creates a firewall exception only for domain and private network locations. To minimize security risks, Enable-PSRemoting does not create a firewall exception for public networks on client versions of Windows. When the current network location is Public, Enable-PSRemoting returns the following message: "Unable to check the status of the firewall."

Example 1

C:\PS>enable-psremoting

Description
-----------
This command configures the computer to receive remote commands.





Example 2

C:\PS>enable-psremoting -force

Description
-----------
This command configures the computer to receive remote commands. It uses the Force parameter to suppress the user prompts.





See Also

Concepts

about_Remote
about_Session_Configurations
Disable-PSRemoting
Get-PSSessionConfiguration
Enable-PSSessionConfiguration
Disable-PSSessionConfiguration
Register-PSSessionConfiguration
Set-PSSessionConfiguration
WSMan Provider