- Windows PowerShell WebAccess
- Install and Use Windows PowerShell Web Access
- Requirements for running Windows PowerShell Web Access
- Browser and client device support
- Supported desktop computer browsers
- Minimally-tested mobile devices or browsers
- Browser requirements
- Recommended (quick) deployment
- Step 1: Install Windows PowerShell Web Access
- To install Windows PowerShell Web Access by using Windows PowerShell cmdlets
- Step 2: Configure the gateway
- To configure the Windows PowerShell Web Access gateway with a test certificate by using Install-PswaWebApplication
- To configure the Windows PowerShell Web Access gateway with a genuine certificate by using Install-PswaWebApplication and IIS Manager
- Step 3: Configure a restrictive authorization rule
- To add a restrictive authorization rule
- Custom deployment
- Step 1: Install Windows PowerShell Web Access
- To install Windows PowerShell Web Access by using the Add Roles and Features Wizard
- Step 2: Configure the gateway
- To use IIS Manager to configure the gateway in an existing website
- To use IIS Manager to configure the gateway as a root website with a test certificate
- Step 3: Configure a restrictive authorization rule
- To add a restrictive authorization rule
- Configure a genuine certificate
- To configure an SSL certificate in IIS Manager
- Using the web-based Windows PowerShell console
Windows PowerShell WebAccess
В Windows Server 2012 появилась новая функция с именем Windows PowerShell Web Access. Как следует из ее названия, данная функция позволяет удаленно управлять сервером Windows 2012 с помощью PowerShell через обычный веб-браузер. Функция Windows PowerShell Web Access реализована в виде приложения IIS, которое выступает в роли шлюза между браузером и сервером, которым вы хотите управлять.
Стоит сразу отметить, что на обоих машинах должна быть включена функция PowerShell remoting. Сделать это можно командой:
Затем приступим к настройке и активации PowerShell Web Access (PWA) на сервере Windows Server 2012
-
- Установим функцию Windows PowerShell Web Access командой
- Устанавливаем Web приложение на IIS
Параметр -UseTestCertificate необходимо указывать, если на сервере не установлен сертификат SSL. В этом случае будет использоваться самоподписанный SSL-сертификат, срок действия которого истечет через 90 дней.
Если вы хотите использовать существующий сертификат, удостоверьтесь что, в настройках сайта в разделе Bindings указан нужный сертификат.
Настройка правил Authorization RulesЭто правило разрешает указанному пользователю подключаться к любому компьютеру с любым конфигурационным именем. Если вы активируете PWA на отдельно стоящем сервере (в рабочей группе), замените название домена на имя сервера.
На этом этапе настройка PWA окончена.
Чтобы подключиться к серверу через Windows PowerShell Web Access, нужно в браузере (это должен быть Internet Explore) нужно перейти по адресу: https :// servername / pswa . Указываем имя пользователя, пароль и имя компьютера, к которому требуется подключиться, и нажмите Sign In.
В результате в браузере откроется консоль PowerShell, готовая к приему и выполнению команд.
Install and Use Windows PowerShell Web Access
Applies To: Windows Server 2012, Windows Server 2012 R2
Windows PowerShellВ® Web Access, first introduced in Windows ServerВ® 2012, acts as a Windows PowerShell gateway, providing a web-based Windows PowerShell console that is targeted at a remote computer. It enables IT Pros to run Windows PowerShell commands and scripts from a Windows PowerShell console in a web browser, with no Windows PowerShell, remote management software, or browser plug-in installation necessary on the client device. All that is required to run the web-based Windows PowerShell console is a properly-configured Windows PowerShell Web Access gateway, and a client device browser that supports JavaScriptВ® and accepts cookies.
Examples of client devices include laptops, non-work personal computers, borrowed computers, tablet computers, web kiosks, computers that are not running a Windows-based operating system, and cell phone browsers. IT Pros can perform critical management tasks on remote Windows-based servers from devices that have access to an Internet connection and a web browser.
After successful gateway setup and configuration, users can access a Windows PowerShell console by using a web browser. When users open the secured Windows PowerShell Web Access website, they can run a web-based Windows PowerShell console after successful authentication.
Windows PowerShell Web Access setup and configuration is a three-step process:
Installing Windows PowerShell Web Access
Configuring the gateway
Configuring authorization rules that allow users access to the web-based Windows PowerShell console
Before you install and configure Windows PowerShell Web Access, we recommend that you read this entire guide, which includes instructions about how to install, secure, and uninstall Windows PowerShell Web Access. The Use the Web-based Windows PowerShell Console topic describes how users sign in to the web-based console, and covers limitations and differences between the web-based Windows PowerShell console and the powershell.exe console. End users of the web-based console should read Use the Web-based Windows PowerShell Console, but do not need to read the rest of this guide.
This topic does not provide in-depth Web Server (IIS) operations guidance; only those steps required to configure the Windows PowerShell Web Access gateway are described in this topic. For more information about configuring and securing websites in IIS, see the IIS documentation resources in the See Also section.
The following diagram shows how Windows PowerShell Web Access works.
Requirements for running Windows PowerShell Web Access
Windows PowerShell Web Access requires Web Server (IIS), .NET Framework 4.5, and Windows PowerShell 3.0 or Windows PowerShell 4.0 to be running on the server on which you want to run the gateway. You can install Windows PowerShell Web Access on a server that is running Windows Server 2012 R2 or Windows Server 2012 by using either the Add Roles and Features Wizard in Server Manager, or Windows PowerShell deployment cmdlets for Server Manager. When you install Windows PowerShell Web Access by using Server Manager or its deployment cmdlets, required roles and features are automatically added as part of the installation process.
Windows PowerShell Web Access allows remote users to access computers in your organization by using Windows PowerShell in a web browser. Although Windows PowerShell Web Access is a convenient and powerful management tool, the web-based access poses security risks, and should be configured as securely as possible. We recommend that administrators who configure the Windows PowerShell Web Access gateway use available security layers, both the cmdlet-based authorization rules included with Windows PowerShell Web Access, and security layers that are available in Web Server (IIS) and third-party applications. This documentation includes both unsecure examples that are only recommended for test environments, as well as examples that are recommended for secure deployments.
Browser and client device support
Windows PowerShell Web Access supports the following Internet browsers. Although mobile browsers are not officially supported, many may be able to run the web-based Windows PowerShell console. Other browsers that accept cookies, run JavaScript, and run HTTPS websites are expected to work, but are not officially tested.
Supported desktop computer browsers
WindowsВ® Internet ExplorerВ® for Microsoft WindowsВ® 8.0, 9.0, 10.0, and 11.0
Mozilla FirefoxВ® 10.0.2
Google Chromeв„ў 17.0.963.56m for Windows
Apple SafariВ® 5.1.2 for Windows
Apple Safari 5.1.2 for Mac OSВ®
Minimally-tested mobile devices or browsers
WindowsВ Phone 7 and 7.5
Google Android WebKit 3.1 BrowserВ Android 2.2.1 (Kernel 2.6)
Apple Safari for iPhone operating system 5.0.1
Apple Safari for iPad 2В operating system 5.0.1
Browser requirements
To use the Windows PowerShell Web Access web-based console, browsers must do the following.
Allow cookies from the Windows PowerShell Web Access gateway website.
Be able to open and read HTTPS pages.
Open and run websites that use JavaScript.
Recommended (quick) deployment
You can install the Windows PowerShell Web Access gateway on a server that is running Windows Server 2012 R2 or Windows Server 2012 by using either Windows PowerShell cmdlets, or by using the Add Roles and Features Wizard that is opened from within Server Manager. For quick installation and configuration, use Windows PowerShell cmdlets, as described in this section.
Step 1: Install Windows PowerShell Web Access
To install Windows PowerShell Web Access by using Windows PowerShell cmdlets
Do one of the following to open a Windows PowerShell session with elevated user rights.
On the Windows desktop, right-click Windows PowerShell on the taskbar, and then click Run as Administrator.
On the Windows Start screen, right-click Windows PowerShell, and then click Run as Administrator.
In Windows PowerShell 3.0 and 4.0, there is no need to import the Server Manager cmdlet module into the Windows PowerShell session before running cmdlets that are part of the module. A module is automatically imported the first time you run a cmdlet that is part of the module. Also, Windows PowerShell cmdlets are not case-sensitive.
Type the following, and then press Enter, where computer_name represents a remote computer on which you want to install Windows PowerShell Web Access, if applicable. The Restart parameter automatically restarts destination servers if required.
Installing Windows PowerShell Web Access by using Windows PowerShell cmdlets does not add Web Server (IIS) management tools by default. If you want to install the management tools on the same server as the Windows PowerShell Web Access gateway, add the IncludeManagementTools parameter to the installation command (as provided in this step). If you are managing the Windows PowerShell Web Access website from a remote computer, install the IIS Manager snap-in by installing Remote Server Administration Tools for Windows 8.1 or Remote Server Administration Tools for Windows 8 on the computer from which you want to manage the gateway.
To install roles and features on an offline VHD, you must add both the ComputerName parameter and the VHD parameter. The ComputerName parameter contains the name of the server on which to mount the VHD, and the VHD parameter contains the path to the VHD file on the specified server.
When installation is complete, verify that Windows PowerShell Web Access was installed on destination servers by running the Get-WindowsFeature cmdlet on a destination server, in a Windows PowerShell console that has been opened with elevated user rights. You can also verify that Windows PowerShell Web Access was installed in the Server Manager console, by selecting a destination server on the All Servers page, and then viewing the Roles and Features tile for the selected server. You can also view the readme file for Windows PowerShell Web Access.
After Windows PowerShell Web Access is installed, you are prompted to review the readme file, which contains basic, required setup instructions for the gateway. These setup instructions are also in the following section, Step 2: Configure the gateway. The path to the readme file is C:\Windows\Web\PowerShellWebAccess\wwwroot\README.txt.
Step 2: Configure the gateway
The Install-PswaWebApplication cmdlet is a quick way to get Windows PowerShell Web Access configured. Although you can add the UseTestCertificate parameter to the Install-PswaWebApplication cmdlet to install a self-signed SSL certificate for test purposes, this is not secure; for a secure production environment, always use a valid SSL certificate that has been signed by a certification authority (CA). Administrators can replace the test certificate with a signed certificate of their choice by using the IIS Manager console.
You can complete Windows PowerShell Web Access web application configuration either by running the Install-PswaWebApplication cmdlet or by performing GUI-based configuration steps in IIS Manager. By default, the cmdlet installs the web application, pswa (and an application pool for it, pswa_pool), in the Default Web Site container, as shown in IIS Manager; if desired, you can instruct the cmdlet to change the default site container of the web application. IIS Manager offers configuration options that are available for web applications, such as changing the port number or the Secure Sockets Layer (SSL) certificate.
|
---|
|
---|