Configure the computer to receive remote commands. Enable-PSRemoting is a proxy for Enable-PSSessionConfiguration.
This is an advanced cmdlet designed for use by system administrators to manage custom session configurations for their users.
Syntax Enable-PSSessionConfiguration [-Force] [-Confirm] [-WhatIf] [CommonParameters] Key -force Suppress all user prompts. By default, you are prompted to confirm each operation. -confirm Prompt for confirmation before executing the command. -whatIf Describe what would happen if you executed the command without actually executing the command. CommonParameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer -OutVariable.
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.
This 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, requires starting PowerShell in elevated mode "Run as administrator" (with the exception of WinXP where elevation is not available.)
Configure the computer to receive remote commands:
PS C:> enable-psremoting
Configure the computer to receive remote commands, with no prompts:
PS C:> enable-psremoting -force
“Absence diminishes mediocre passions and increases great ones, as the wind blows out candles and fans fires” ~ La Rochefoucauld
Disable-PSSessionConfiguration - Deny access to PS session configuration
Get-PSSessionConfiguration - Get the registered PS session configuration