Windows Server 8 – Web Based PowerShell !

One another great feature of Windows Server 8 is ability to run your PowerShell commands on your browser from anywhere. This is really amazing feature. While PowerShell is becoming a “must” tool for almost all Microsoft products, using it on your mobile phone or browser will add great value to our day-to-day tasks.

This feature is called as Windows PowerShell Web Access and it resides as a Windows Server 8 feature.

In this blog post we’ll discuss how to install and configure this amazing feature.

PowerShell Web Access is not enabled by default in Windows Server 8. So firstly you have to add this feature using new designed Server Manager.

Open your Server Manager and click  Add Roles and Features

image

Click Next for the Welcome Page.

image

In Features page, Select Windows PowerShell Web Access

image

Some IIS features are required to manage PowerShell over IIS.

image

Finish Installation.

image

image

As you notice setup warns us about additional configuration requirements.

These are;

  • An application Pool on IIS
  • A Web Application
  • A Certificate

For testing purposes you can use one simple line PowerShell command to configure all above steps.

Install-PswaWebApplication –UseTestCertificate

This command creates required application pool and web application. Also it creates  and binds a self-signed certificate.

Please note that using a test certificate in a production environment is not recommended due to security reasons.

image

Here is the virtual directory that is created by command.

image

In order to connect /pswa virtual directory remotely, we have to create an authorization rule. By default no authorization rule is defined. You can check it with Get-PswaAuthorizationRule cmdlet.

image

To create authorization rule Add-PswaAuthorizationRule command can be used. But before, I created an Active Directory group called PSAdmins and add administrator as member.

image

And used –UserGroupName parameter.

image

You can also use –UserName parameter to create authorization rule for individual user objects.

 

Authorization rules are XML files and stored in WindowsWebPowerShellWebAccessData directory.

image

You can manually edit and configure these files;

image

Now on my Windows 8 Client machine, I browse for related server with /pswa directory.

It gives certificate error as expected due to self-signed certificate.

image

Providing my credentials.

image

And here is the Web Based PowerShell. It’s connected to remote machine and all executed PS Commands runs on remote machine.

image

Now you can manage your systems with PowerShell from anywhere. Only requirement is to access related pswa directory over HTTPS. That’s really cool!

image

Anıl Erduran.