What do you think about the ability to remotely manage Windows Server 2012 R2? And what if I make such access with via PowerShell in the web environment?
In fact, it is quite easy just a moment of IT fun plus some configuration in PowerShell Web Access Gateway and we have access to the PowerShell console from every corner of the world.
We start by installing Windows PowerShell Web Access. Just for this purpose on our Windows Server 2012 launch Server Manager and select Add Roles and Services, then you can locate interesting us feature and install it. Of course we accept all the necessary things that wizard want from us.
Now configure the Access Gateway Web PowerShell. For this we use the PowerShell command:
Install- PswWebApplication - UseTestCertificate
(after final testing I advise to use the appropriate certificate !!!) . This command installs the Windows PowerShell Web Acces inside a container IIS Default Web Site. What ultimately resulting in the firing of our environment on a web address https://our_server_name/pswa, but if we want other name eg https:// our_server_name /powershell it is sufficient to modify the name using parameter WebApllicationName .
Well generally the result of our work is already visible under the mentioned address, but login is still not possible. To change this behavior we need grant access to users with administrative level privileges Windows PowerShell. Of course, the management of Windows PowerShell Web Access is via a set of command line commands. For our example we will use the rule with a wide range of authentication.
Add- PswaAuthorizationRule -username * - ComputerName * - * ConfigurationName
Now everything is ready and you can access the Gateway from any computer on the Internet. But since we used a test certificate you receive an error when connecting to the site, however go ahed and click Continue to this website. We will be welcome with the login window and then if you log in yiou will see the PowerShell console window