Windows PowerShell Web Access
In the Windows Server Developer Preview (“Windows 8 Server”) released recently, a preview version of Windows PowerShell 3.0 is also included. In addition to the many news in the next version of PowerShell which I won`t cover in this article is a brand new feature named Windows PowerShell Web Access. As the name indicates this makes it possible to use Windows PowerShell using a browser from a computer, in addition to mobile devices.
Installation, configuration and user experience
Windows PowerShell Web Access is available as a feature in the new Server Manager:
After the feature is installed, some additional steps which is described in %systemroot%\Web\PowerShellWebAccess\wwwroot\README.txt is required:
To complete the installation of Windows PowerShell Web Access, please perform the
following tasks:1) Open a Windows PowerShell console with elevated user rights.
To do this, right click on PowerShell.exe, or a Windows PowerShell shortcut,
and then click “Run as administrator.”2) Be sure your Windows PowerShell environment is configured to run scripts.
For more information, see “Running Scripts from Within Windows PowerShell”
(http://technet.microsoft.com/en-us/library/ee176949.aspx).3) Run the following script:
${env:\windir}\Web\PowerShellWebAccess\wwwroot\setup.ps1
This is typically C:\Windows\Web\PowerShellWebAccess\wwwroot\setup.ps1
4) Create a server certificate.
For a test server, you can create a self-signed certificate by using the
Web Server (IIS) management console:(${env:\windir}\system32\inetsrv\InetMgr.exe)
From within the IIS management console, open the Web Servers parent node.
This is typically the node immediately under the Start Page node.In the results pane, select “Server Certificates” on the center pane, then
select “Create Self-Signed Certificate.”5) Create an SSL binding.
In the IIS management console, select “Default Web Site,” and then click
“Bindings” on the “Actions” menu. Click “Add,” select “https” on
the “Type” pull-down menu, and then in the “SSL certificate” list, select the
certificate that you created in step 4.For more information about how to create a server certificate and an SSL binding,
see “How to Set Up SSL on IIS 7″
(http://learn.iis.net/page.aspx/144/how-to-set-up-ssl-on-iis-7).
The setup.ps1 script will create a new Web Application Pool and a new Web Application in Internet Information Services:
$ErrorActionPreference = ‘stop’
$wwwroot = “${env:\windir}\Web\PowerShellWebAccess\wwwroot”
if (!(Test-Path $wwwroot))
{
Write-Error “PowerShell Web Access has not been installed on this machine”
}
#
# Copy localized files to neutral location
#
foreach ($target in ($wwwroot,”$wwwroot\bin”))
{
foreach ($culture in (“en”,”en-us”,”qps-ploc”))
{
$source = “$target\$culture”
if (Test-Path $source)
{
copy “$source\*” $target
}
}
}
#
# Setup ASP.NET application
#
Import-Module WebAdministration
if (Get-WebApplication -name “pswa”)
{
Write-Error “The Windows PowerShell Web Access application (pswa) already exists on this machine”
}
New-WebAppPool “pswa”
New-WebApplication -Name “pswa” -Site “Default Web Site” -PhysicalPath $wwwroot -ApplicationPool “pswa”
If the script runs successfully, it returns the following output:
PS C:\> C:\Windows\Web\PowerShellWebAccess\wwwroot\setup.ps1
Name State Applications
—- —– ————
pswa Started
Path : /pswa
ApplicationPool : pswa
EnabledProtocols : http
PhysicalPath : C:\Windows\Web\PowerShellWebAccess\wwwroot
The final configuration step is to create and add a binding to a certificate as described in the link provided in the readme.txt file.
When done, you can access the feature by using the URL https://<servername>/pswa :
Specify credentials and a computer name to connect to, then hit the “Sign in” button. Another connection type available is “Connection URI”:
The options available under “Advanced Options”:
The available authentication types:
After signing in, you`ll be presented with a console looking like this:
The console host is called “ServerRemoteHost”:
Tab-completion works just like in the regular Windows PowerShell console host, and we also have access to the history by pressing the up and down arrows. To logoff, there is a Logoff-button in the bottom right corner.
The PowerShell Web Access also works perfectly fine on mobile devices. I`ve tried it on a Windows Phone 7 device, but unfortunately I don`t have any screen captures to share yet.
Congratulations to the Windows PowerShell team for providing this excellent new feature!
Note: Please be aware that this is a feature in a prerelease version of the next version of Windows Server, and thus the feature might be different in the final product.
Update 15.09.2011
Screen capture from PowerShell Web Access running on an Iphone:






This is quite incredible. I’ve come to rely upon and develop short applications in Powershell (away from C#) because I can do most of the same things and more quickly. Having this available via browser (and I presume “any” browser) will be an incredible leap forward.
Hello JAn
…
Great post !
However I tried to activate this on my Win 8 server preview VPC and it doesn’t work (yet !
I am now blocked on the login window (everything before went well : PS script and IIS config were OK)…
Do you use standard options (username, pwd and Computer name) only to connect or some choice of advanced options ?
Thanks in advance & Regards,
Patrick [SharePoint MVP]
Thanks!
I logged on using standard options. Is PowerShell Remoting enabled on the computer you`re trying to connect to? If yes, what is the error message?
[...] 4) Добавилась новая роль WindowsPowerShellWebAccess, теперь позволяет работать с PowerShell, через с помощью броузера , подробнее про установку роли – http://blog.powershell.no/2011/09/14/windows-powershell-web-access/ [...]
Pingback by Новинки PowerShell V3 часть 4 « Kazun | September 19, 2011 |
[...] Pour plus de détails, voir ce site : http://blog.powershell.no/2011/09/14/windows-powershell-web-access/ [...]
Pingback by [Windows 8 Server] Premières impressions (2/2)… , Le blog de Patrick [MVP SharePoint] | September 20, 2011 |
Hello,
Yes PS Remoting has been activated. The error message is “cannot establish a connection to the target computer”;
anyone resovled this issue?
I had no time to test it again however I think that during the test my AD was not confiugred completely (dcpromo was not passed) and that should certainly have been the cause of the issue.
Using powershell on the browser is really nice, it’s the point of access towards developer tools hosted in the cloud
If you’d like to learn about how to get Powershell V3 CTP outside the Windows 8 preview and some new cool stuff, fell free to visit this post: https://rambletech.wordpress.com/2011/09/21/windows-powershell-v3-includes-command-like-wgetcurl/
[...] a much-enhanced array of PowerShell cmdlets and the ability to log onto servers via the web with PowerShell Web Access brought a number of thoughts to mind (read my WindowsITPro.com blog for more on this [...]
Pingback by Windows Server 8, Exchange, and Digital Command Language | Thoughtsofanidlemind's Blog | September 22, 2011 |
I can’t seem to do remoting from the web console. If I do an icm to another computer, I get “Connecting to remote server failed.” But it works fine if I log into the server and use the regular posh console. Is remoting disabled through pswa?
Hello there. PSWA runs on top of a PowerShell Remoting connection so if you try to establish another remoting connection (in this case via icm) you’d be doing a “second-hop”. Try providing your credentials to icm: “icm –credential $(get-credential) …”.
[...] PowerShell Web Access in the next version of Windows Server, which I`ve previously written an article [...]
[...] and run Unlock-ADAccount <username>. Screenshots and installation guidance is available in this blog [...]
Pingback by PowerShell Magazine » An overview of Windows PowerShell features in Windows Server 8 Developer Preview | October 3, 2011 |
[...] Windows PowerShell Web Access [...]
Pingback by Episode 162 – Mike Pfeiffer from Interface Technical Training « PowerScripting Podcast | October 18, 2011 |
[...] http://blog.powershell.no/2011/09/14/windows-powershell-web-access/ [...]
Pingback by PowerShell Web Access » RO Windows Administrators Weblog | November 18, 2011 |
[...] todos ser chamando este “PWA” nos próximos meses.Você pode ver algumas grandes exemplos de como funciona esse recurso no blog do MVP Jan Egil [...]
Pingback by Windows PowerShell: Conheça o novo Shell | January 4, 2012 |
[...] nós vamos todos ser chamando este “PWA” nos próximos meses.Você pode ver algumas grandes exemplos de como funciona esse recurso no blog do MVP Jan Egil [...]
Pingback by Windows PowerShell: Conheça o novo Shell « Marcelo Nogueira | January 4, 2012 |
I have tried adding the CPT2 to Windows 2008 Server R2. It installs fine, but I can’t find any of the Web Access scripts so I am kind of stuck. Any help would be appreciated.
Hi Ferdinand,
The Web Access feature is part of “Windows Server 8″, it won`t be available for downlevel OS`es.