Saturday, August 25, 2012

Install and Configure Windows PowerShell Web Access in Three Easy Steps

Windows PowerShell Web Access Gateway Architecture


Windows PowerShell Web Access is a new feature in Windows Server 2012. It is an IIS application that provides a Windows PowerShell console in a web browser. The IIS application acts as a gateway between the web browser and the machines that you can connect to in your environment. These machines should have Windows PowerShell remoting enabled.

There are a number of resources that explain how to configure PowerShell Web Access, including this video.  I want to tell you how to do it in as few steps as possible. 

The following is all done from an elevated PowerShell window of the Windows 2012 server you want to install PWA on.

1.      Import the Server Manager PowerShell module and install the Windows PowerShell Web Access feature

Import-Module ServerManager 
Install-WindowsFeature -Name WindowsPowerShellWebAccess -IncludeManagementTools

2.      Install the Web Application in IIS

Install-PswaWebApplication [-UseTestCertificate]
 
Add the -UseTestCertificate  parameter if you don’t already have an SSL certificate installed on the server.  This will install a self-signed SSL certificate that will expire in 90 days.

To use an existing SSL certificate, make sure it is configured in Bindings on the Website to use that certificate.


3.      Configure Authorization Rules

Add-PswaAuthorizationRule -UserName domain\username -ComputerName * -ConfigurationName *
 
This Authorization Rule will allow the specified account to connect to any computer with any configuration name.
If you are installing on a workgroup server substitute the computer name for domain.

That's all there is to it! 
You can access Windows PowerShell Web Access from Internet Explore using the following URL: https://servername/pswa
Windows PowerShell Web Access Login
Enter your user name, password, and the computer name you want to connect to and then click Sign In
 

Windows PowerShell Web Access
 
A Windows PowerShell window will open in your IE browser, connected to the computer you targeted.
 
As mentioned above, the target computer must have Windows PowerShell remoting enabled.  You can do this by running the following command from an elevated PowerShell prompt:
 
 Enable-PSRemoting -Force

11:00 AM