How to Install and Use Windows PowerShell Web Access

I was reading and doing LAB on Windows PowerShell few days ago and it came to mind that, what if there's a way to access Windows PowerShell from Internet. No VPN, Domain login etc. Just pure internet and you can access your environment over the internet and work on applications like Exchange, Lync etc.

And I found that there's something called Windows PowerShell Web Access. Unbelievably awesome feature. Now here is the requirement you must full fill to deploy Windows PowerShell Web Access in your environment.

You Must Have:
1: Windows PowerShell 3.0
2: At least One Windows Server 2012.

On Windows Server 2012 you have Windows PowerShell 3.0 installed by default. Lets check if Windows PowerShell Web Access is installed or not.
Run this command Get-WindowsFeature "PowerShell"












Now as you see Windows PowerShell Web Access is available. Next we are going to install this feature on the server, remember you need to run this on Windows Server 2012.

Install-WindowsFeature WindowsPowerShellWebAccess








Installation has completed successfully and no restart required. :) After it gets installed it will add 6 new modules to PowerShell and we can see it by running Get-Help Cmdlets.
Get-Help *pswa*










Installing PowerShellWebAccess isn't completes the process. It needs function called PswaWebApplication which we got after installing WindowsPowerShellWebAccess. Also you are going to need Certificate also, remember you are going to access PowerShell over the internet and hence it has to be https (secure). If you are running in the Test environment you might not have certificate and for that you will have to run this command "Install-PswaWebApplication -UseTestCertificate".  But I already have certificate installed on the server hence I wouldn't need to run the above command.

Install-PswaWebApplication
















Now we have PswaWebApplication installed on the server, lets check IIS if it's listed there or not. Open IIS, expand the server and under ApplicationPool at the bottom you will see pswa_pool.
























At this point we have installed PSWA on the server and it's ready to use, but wait next most important thing is to authorize user who can run what and what to not. Like which server they can access and which server they shouldn't. To authorize we will run this command "Add-PswaAuthorizationRule".








Note:
As this is LAB environment I am running this command as it will give access to everyone. You do not want to run this in your production ever.

Run this command to start the browser with PowerShell.





After you ran this command you should have Internet Explorer open asking you for the credentials.





















Enter the credentials.





















































There you go, you are connected to Windows PowerShell in your web browser.

Cheers,

Leave a Reply

EXCHANGE RANGER