PowerShell 2.0: One Cmdlet at a Time 30 Enable-PSRemoting
Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Enable-PSRemoting cmdlet.
What can I do with it?
Configure a computer to be enabled for PowerShell remoting. Tip: Make sure you run this cmdlet from an elevated process.
Example:
Configure the computer Test01 to be enabled for PowerShell remoting.
Enable-PSRemoting
This will produce output similar to the below; note the command was run on a Windows Server 2008 64bit system
You will notice from the output that it runs two other PowerShell 2.0 cmdlets, Set-WSManQuickConfig and Register-PSSessionConfiguration. The below (taken from PowerShell help) gives a great summary of what each will do in this instance.
-- 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.
How could I have done this in PowerShell 1.0?
Remoting did not exist in PowerShell 1.0, you would have needed to use Remote Desktop to run an interactive session on a remote server.