Server Management Overview
Server Management Overview
Server Management Overview
Windows Server 2008 provides new tools, technologies and installation options to
improve the management experience.
For local administration of a single server, Server Manager is an integrated Microsoft
Management Console that offers IT professionals a seamless, integrated experience for
adding, removing, and configuring server roles, role services, and features. It also acts as
a portal for ongoing server management, monitoring and operations, by exposing key
management tasks based on server role, and providing access to advanced administration
tools.
Overview
There are a variety of utilities in Windows Server 2008 designed to allow easy, efficient
management. This section will provide an overview of the primary and secondary
management tools available to you, as well as improvements to assist with printer
management.
Print Management
Print Management Overview
Effective print management can save you a significant amount of time when installing
printers on client computers and in managing and monitoring printers. Windows
Server 2008 includes Print Management, which is an MMC snap-in that enables you to
manage, monitor, and troubleshoot all of the printers within your organization from a
single interface, even those in remote locations such as branch offices.
Print Management provides centralized administration of all of the printers in the
organization from any computer running Windows Server 2003 R2, Windows Vista,
or Windows Server 2008 operating systems. Print Management is also available for
Windows XP clients (x86 and x64).
Print Management provides up-to-the-minute details about the status of all printers and
print servers on the network from one console. Print Management can help find printers
that have error conditions, and can also send e-mail notifications, or run scripts when a
printer or print server needs attention. On printer models that provide a Web interface,
Print Management can access this additional data allowing information such as toner and
paper levels to be managed easily.
By using Print Management in conjunction with the Configure Your Server Wizard and
Terminal Services, you can automatically search for and install network printers on a
local print server in branch offices. This is helpful when branch office personnel are not
trained in administrative duties.
Troubleshooting Printers
Print Management has several features that may help identify and resolve printer
problems, even in remote locations:
Setting pre-defined filters lets you easily find all printers that are not in Ready status
or that have print jobs backed up queue.
Many devices, regardless of manufacturer, provide rich status information, which is
readily available to Print Management. By closely monitoring the printers within the
organization, you may be able to resolve problems before they happen, such as
identifying when paper or toner is low.
E-mail message notifications can be set up to alert administrators when a printer
requires attention. This is especially useful when your organization has printers at
multiple locations with different people responsible for managing them. By using an
automated system to notify the IT staff when a printer or print server is down, the
problem may be resolved sooner reducing the impact of printer and print server
problems.
Technical Background
Initial Configuration Tasks
After Setup for Windows Server 2008 is complete, Initial Configuration Tasks guides
you through the procedures that are necessary to configure a new server, such as
specifying the administrator password, the computer name, the domain, and desired
server roles.
Initial Configuration Tasks replaces the Post-Setup Security Updates feature that was
introduced in Windows Server 2003 Service Pack 1 (SP1). Initial Configuration Tasks
extends the functionality of Post-Setup Security Updates by guiding you through all of
the tasks you must complete to configure a new server, not just those tasks that are
related to security.
With Initial Configuration Tasks, it is much easier to configure a new server with
Windows Server 2008 than it was to configure a new server with Windows Server 2003
operating systems. For example, during Setup you are asked for only minimal
information, such as product key information and an acceptance of the End-User License
Agreement. After you have installed the operating system, you can then use Initial
Configuration Tasks to configure the server. Setup assigns default values for other
configurations unless you specify otherwise. For example, by default, network cards are
configured to obtain an Internet Protocol (IP) address that is assigned by Dynamic Host
Configuration Protocol (DHCP). Also, by default, the server will be a member of a
workgroup.
The main window of the Server Manager console contains the following four collapsible
sections:
Server Summary. This section includes two subsections, System Information and
Security Summary.
System Information displays the computer name, domain, local administrator
account name, network connections, and the product ID of the operating system.
Commands in the System Information subsection allow you to edit this
information.
Security Summary displays whether Windows Update and Windows Firewall are
enabled. Commands in the Security Summary subsection allow you to edit these
settings or view advanced options.
Roles Summary. This section contains a table indicating which roles are installed on
the server. Commands in this section allow you to add or remove roles, or go to a
more detailed console in which you can manage a specific role.
Features Summary. This section contains a table indicating which features are
installed on the server. Commands in this section allow you to add or remove features.
Resources and Support. This section displays whether this server is participating in
the feedback programs Windows Server CEIP and Windows Error Reporting.
Resources and Support is also designed to be a launch point for joining topical
newsgroups, or for locating additional Help and research topics available online.
Server Manager Wizards
The Server Manager collection of wizards allows you to add, remove, or augment
multiple roles in a single session, streamlining the task of deploying servers in your
enterprise by reducing the time required. Role configurations are configured with
recommended security settings by default; there is no requirement to run the Security
Configuration Wizard following role or feature installation unless it is necessary to
modify security defaults.
Earlier versions of Windows Server required you to use Configure Your Server, Manage
Your Server, or Add or Remove Windows Components to add or remove server roles or
other software. Dependency checks were limited, and Add or Remove Windows
Components limited administrators to the installation of only one role at a time. Before
you could add more roles, installation of each role had to complete. Windows
Server 2008 performs dependency checks as you progress through the Server Manager
wizards, ensuring that all the roles and role services needed by a role you select are
installed, and none are removed that might still be required by remaining roles or role
services.
The following roles are available in Windows Server 2008 and can be installed and
managed through Server Manager:
What Are Features?
A feature does not generally describe the primary function of the server. Instead, it
describes an auxiliary or supporting function. Consequently, an administrator typically
installs a feature not as the primary function of the server, but to augment the
functionality of an installed role. For example, Failover Clustering is a feature that
administrators can choose to install after installing specific roles, such as File Server, in
order to make the File Server role more redundant.
The following features are available in Windows Server 2008 and can be installed by
using Server Manager:
Implementation/Usage Scenarios
Improved New Server Deployment and Configuration
Windows Server 2008 installation procedures allow administrators to postpone nonessential
tasks until the installation is complete, meaning fewer interruptions during
the installation.
Initial Configuration Tasks provides an easy, secure way to complete important
configuration tasks and guides IT administrators through the process of configuring a
new server, ensuring that required tasks are performed.
Improved Security
Roles and features installed by using Server Manager are secure by default.
Administrators can subsequently run the Security Configuration Wizard to change
the default settings.
Improved Server Administration
The Server Manager console provides a single interface to:
Provide a consolidated view of the server, including information about server
configuration, status of installed roles and features.
Provide a method to add or remove roles and features from a server.
Perform management tasks associated with the operational lifecycle of the server,
such as starting or stopping services, and managing local user accounts.
Determine server status, identify critical events, and analyze and troubleshoot
configuration issues or failures.
ServerManagerCmd.exe allows you to automate the deployment of server roles and
features in Windows Server 2008. It can also be used with an XML file to expedite
automated unattended installations and to add/remove roles and features.
Server Core
Overview
Server Core Installation
Server core is not a separate version of Windows Server 2008; rather, it is a new
installation option which provides a minimal environment for running specific server
roles, reducing the maintenance and management requirements and the attack surface for
those servers. There are no changes to your environment or infrastructure required.
A server core installation supports the following server roles:
Active Directory Domain Services
Active Directory Lightweight Directory Services
DHCP Server
DNS Server
File Services
Print Services
Windows Media Services
Windows Virtualization Services
You can run Windows Server Virtualization (WSv) using a Server Core installation
of Windows Server 2008 as a host system. This will allow you to benefit from
Server Cores reduced software maintenance and file management needs and its
smaller footprint (less than 1GB of disk space is required for operating system
installation).
The server core installation option installs only the subset of the Server binaries that are
required by the above server roles. For example, the Explorer shell is not installed as part
of a server core installation. Instead, the default user interface for a server running a
server core installation is the command prompt.
A server core installation is ideal in situations where you need to:
Increase server stability.
Reduce server management.
Reduce the attack surface of a server.
Reduce software maintenance.
Reduce hardware requirements.
Benefits
A server core installation of Windows Server 2008 provides the following benefits:
Because a server core installation installs only what is required to run the supported
server roles:
Less servicing is required than on a full installation of Windows Server 2008 and
the server is more stable.
Less maintenance is required than on a full installation of Windows Server 2008.
Because fewer applications run on the server:
The attack surface of the server is decreased.
There is less to manage.
Hardware requirements are reduced because a server core installation requires less
disk space.
Do I need to change my code to work with Windows Server 2008?
Server Core is not an application platform; therefore, you cannot run or develop server
applications on a Server Core installation. A Server Core installation can only be used to
run the supported server roles and management tools. Server Core does, however, support
development of management tools and agents, which can be divided into two categories:
Remote Management tools. These tools do not require any changes, as long as they
use one of the protocols supported in Server Core to communicate with the remote
management workstation, such as RPC.
Local Management tools and agents. These tools might require changes to work with
Server Core, since they cannot have any shell or user interface dependencies, nor use
managed code.
Technical Background
Prerequisites for Deploying a Server Core Installation
An installation of Windows Server 2008 server core requires the following:
Windows Server 2008 media
A valid product key
A computer on which you can do a clean installation of server core
Only clean installations of Windows Server 2008 server core are supported.
There is no way to upgrade from a previous version of the Windows Server
operating system to a server core installation.
There is no way to upgrade from a full installation of Windows Server 2008 to a
server core installation.
There is no way to upgrade from a server core installation to a full installation of
Windows Server 2008.
Administrative credentialsif you are going to join the server core installation to an
existing Windows domain, you will need a user name and password for an account
that has the credentials to join a computer to the domain.
Deploying a Server Core installation
Because a server core installation does not include the Windows user interface, there is
no "Out of Box Experience" to allow you to complete the configuration of the server.
Instead you must manually complete the configuration using the command-line tools or
by performing an unattended install using
All commands in Server Core are case sensitive.
In addition to benefits typical of using an unattend file, performing an unattended install
of server core also provides the following benefits:
There is no need to perform the initial configuration using command-line tools.
You can include the settings in the unattend file to enable remote administration as
soon as setup is complete.
You can configure settings that cannot be easily modified from the command line,
such as display resolution.
The steps required for configuring a server core installation are as follows:
Set the password for the local administrator account.
In the command prompt, type net user administrator * and then press Enter. Type
the administrator password and press Enter.
Set a static IP address using standard NETSH commands (if you are not using
DHCP).
In the command prompt, type ipconfig /all and press ENTER. (The default setting
for the network configuration is displayed. By default Windows Server 2008 server
core uses DHCP configuration.)
In the command prompt, type netsh interface IPv4 show interface and then press
ENTER. (The list of network interfaces for the server are now shown. Note the Idx
value for the Local Area Connection.)
In the command prompt, type netsh interface ipv4 set address name=2
source=static address=192.168.1.50 mask=255.255.255.0 and press ENTER.
In the command prompt, type ipconfig /all and press ENTER. (The network
interface idx value was used as the name in the previous command. In addition,
the setting for gateway may be required in most circumstances. The return of the
ipconfig command reflects the new settings.)
In the command prompt, type netsh interface ipv4 add dnsserver name=2
address=192.168.1.1 index=1 and press ENTER. (The DNS Server setting has
been added to the interface. To add additional DNS server addresses, repeat the
command and increment the index value by 1.)
Join a domain (if the server will be a member) and activate the server.
In the command prompt, type netdom join NYC-CORE-01
/domain:woodgroovebank.com /userd:administrator /passwordD:* and press
ENTER.
When prompted, type the administrator password and press Enter.
In a production environment it would also be necessary to activate the server. From
the command line, this can be done by using: Slmgr.vba ato.
To complete the configuration, reboot the server.
View/Configure the Firewall.
In the command prompt type netsh and press Enter. Type advfirewall and press
Enter.
In the command prompt, type show mode and press ENTER. The returned value
indicate that the firewall is currently turned on.
You can configure rules via the netsh advfirewall firewall prompt.
Server Roles on a Server Core Installation
Once the server core installation is complete and the server is configured for use, you can
then install one of more of the supported server roles and associated features.
DNS Server. To install the DNS server role
From the command, type:
Start /w ocsetup DNS-Server-Core-Role
You can also uninstall roles and features with the ocsetup command, for example:
start /w ocsetup DNS-Server-Core-Role /uninstall
DHCP Server. To install at the command prompt, type:
Start /w ocsetup DHCPServerCore
Configure a DHCP scope from the command line using netsh, or remotely using
the DHCP snap-in.
If the DHCP server is installed in an Active Directory domain, dont forget to
authorize it in Active Directory.
File Server. This role is installed by default; however, there are a number of features
that you can install from the command line as follows:
File Replication Service: start /w ocsetup FRS-Infrastructure
Distributed File System: start /w ocsetup DFSN-Server
Distributed File System Replication: start /w ocsetup DFSR-Infrastructure-
ServerEdition
Network File System: start /w ocsetup ServerForNFS-Base
DFSR is a brand new replication engine. FRS still exists in Windows Server 2008
and is used by default for SYSVOL replication. Once clients have established a
Windows Server 2008 Domain Functional Mode they will be able to utilize DFSR
and remove FRS.
Media Services. To install this role, at the command prompt, type:
start /w ocsetup MediaServer
After installation, use the Media Services MMC to remotely configure media
services.
Active Directory Domain Services. To install this role, at the command prompt, type:
Dcpromo /unattend:Unattendfile where Unattendfile is the name of a dcpromo
unattend file
Implementation/Usage Scenarios
Reduced Maintenance
Because a server core installation installs only what is required to run the supported
server roles, less maintenance is required than on a full installation of Windows
Server 2008.
Reduced Attack Surface
Because server core is a minimal installation, there are fewer applications run on the
server, thereby decreasing the attack surface.
Reduced Management
Because fewer applications and services are installed on a server running the server core
installation, there is less to manage.
Less Disk Space Required
Less disk space is required for a server core installation.
Windows PowerShell
Overview
What is Windows PowerShell?
Windows PowerShell is a new Windows command-line shell designed especially for
system administrators. The shell includes an interactive prompt and a scripting
environment that can be used independently or in combination. In Windows Server 2008,
it is installed as a feature.
Windows PowerShell is considered to be the new standard for command-line and
scripting for administrators. Future tools will be built around it and will generate scripts
for you so that you to use.
Windows PowerShell provides an easier way for you to perform administrative tasks. For
example, in the past in order to make a change to the registry you would need to import
or export files. With PowerShell you can simply write to the registry as though it were
any other file.
While Windows PowerShell is considered to be the new standard, it is not a
replacement for existing mechanisms, such as VBScript or WMI scripting.
What are PowerShell Cmdlets?
Windows PowerShell can still run any external command line utilities that you are used
to using, which means you can use it immediately, taking advantage of the knowledge
and experience you already have while learning to use the new power that PowerShell
provides.
By combining access to all of these features, Windows PowerShell extends the ability
of the interactive user and the script writer, and makes system administration more
manageable.
Object Orientation. Although you interact with Windows PowerShell by typing
commands in text, Windows PowerShell is based on objects, not text. The output of a
command is an object. You can send the output object to another command as its
input. As a result, Windows PowerShell provides a familiar interface to people
experienced with other shells, while introducing a new and powerful command-line
paradigm. It extends the concept of sending data between commands by enabling you
to send objects, rather than text.
Easy Transition to Scripting. Windows PowerShell makes it easy to transition from
typing commands interactively to creating and running scripts. You can type
commands at the Windows PowerShell command prompt to discover the commands
that perform a task. Then, you can save those commands in a transcript or a history
before copying them to a file for use as a script.
Security. Windows PowerShell provides for increased security because:
Scripts cannot be run by default.
Scripts can be configured to only if they are digitally-signed.
Scripts are not permitted to highjack a command name.
While the PS1 filename extension is assigned to PowerShell scripts, by default it
is not associated with PowerShell. If you double-click on a .ps1 file, it will open
it in Notepad rather than launching it.
PowerShell security is centrally-controllable. An Administrative (ADM) template
adds Windows PowerShell options to a Group Policy Object (GPO).
What can I do with Windows PowerShell?
With Windows PowerShell you can:
Automate administration of multiple servers through a task-oriented scripting
language.
Accelerate script authoring, testing and debugging and write customer tools in a new
command shell environment.
Utilize new scripts and Cmdlets.
Manage command-line services, processes, registry, and WMI data.
Manage and/or automate administration tasks for server roles such as IIS and Active
Directory.
Technical Background
Native Support for Different Type Systems
Windows PowerShell adapts WMI, XML, ASDI, ADO, and COM objects to provide a
common syntax to access their properties and methods.
Working with Cmdlets
You can run Windows command-line programs in Windows PowerShell, and you can
start Windows programs that have a graphic user interface, such as Notepad and
Calculator, within the shell. You can also capture the text that programs generate and use
that text in the shell, in much the same way you would in Cmd.exe.
In traditional shells, commands are executable programs that range from the very simple
(such as attrib.exe) to the very complex (such as netsh.exe). In Windows PowerShell,
most cmdlets are very simple, and they are designed to be used in combination with other
cmdlets. For example, the "get" cmdlets only retrieve data, the "set" cmdlets only
establish or change data, the "format" cmdlets only format data, and the "out" cmdlets
only direct the output to a specified destination.
Each cmdlet has a help file that you can access by typing:
get-help <cmdlet-name> -detailed
The detailed view of the cmdlet help file includes a description of the cmdlet, the
command syntax, descriptions of the parameters, and example that demonstrate use of the
cmdlet.
For example, when you get a service in Windows PowerShell, you are really getting
an object that represents the service. When you view information about a service, you
are viewing the properties of its service object. And, when you start a service, that is,
when you change the Status property of the service to "started," you are using a
method of the service object.
All objects of the same type have the same properties and methods, but each instance
of an object can have different values for the properties. For example, every service
object has a Name and Status property. However, each service can have a different
name and a different status.
Using Familiar Command Names (Aliasing)
Using a mechanism called aliasing, Windows PowerShell allows you to refer to
commands by alternate names. Aliasing allows users with experience in other shells to
reuse common command names that they already know to perform similar operations in
Windows PowerShell.
Aliasing associates a command name that you type with another command. For
example, Windows PowerShell has an internal function named Clear-Host that
clears the output window. If you type either the cls or clear command at a command
prompt, Windows PowerShell interprets that this is an alias for the Clear-Host
function and runs the Clear-Host function.
Aliasing helps you to learn Windows PowerShell. First, most users have a large
repertoire of commands that users already know by name, and although the Windows
PowerShell equivalents may not produce identical results, they are close enough in
form that users can use them to do work without having to first memorize the
Windows PowerShell names. Second, the major source of frustration in learning a
new shell when the user is already familiar with another shell is the errors that are
caused by "finger memory". If you have used Cmd.exe for years, when you have a
screen full of output and want to clean it up, you would reflexively type the cls
command and press the ENTER key. Without the alias to the Clear-Host function in
Windows PowerShell, you would simply get the error message "'cls' is not
recognized as a cmdlet, function, operable program, or script file" and be left with no
idea of what to do to clear the output.
Windows PowerShell Navigation
Folders, or directories as they are more commonly known, are a useful concept for
organizing files and other directories. This approach does not ensure that the content is
readable or usable by particular applications, but it does make it simpler to find specific
items. Tools that enumerate or search through files and folders work with these devices
as well. You can also address a specific item by using the path to the file that represents it.
Working with Files and Folders. Navigating through Windows PowerShell drives
and manipulating the items on them is similar to manipulating files and folders on
Windows physical disk drives.
Working with Registry Keys and Entries. Because registry keys are items on
Windows PowerShell drives, working with them is very similar to working with files
and folders. One critical difference is that every item on a registry-based Windows
PowerShell drive is a container, just like a folder on a file system drive. However,
registry entries and their associated values are properties of the items, not distinct
items.
Windows PowerShell Security
Scripting is a very powerful tool, but it can be misused for malicious purposes. To protect
user data and the integrity of the operating system, Windows PowerShell includes several
security features, among which are the execution policy and PowerShell profiles.
Execution Policy. The Windows PowerShell execution policy determines whether
scripts are allowed to run and, if they can run, whether they must be digitally signed.
It also determines whether configuration files can be loaded.
The default execution policy, Restricted, is the most secure of the execution policies.
It does not permit any scripts to run, and it does not permit any configuration files,
including a Windows PowerShell profile, to be loaded. You can still use Windows
PowerShell interactively; however, if you want to run scripts or load configuration
files, you would have to change the execution policy on your system.
Windows PowerShell Profiles. When you add aliases, functions, and variables to
Windows PowerShell, you are actually adding them only to the current Windows
PowerShell session. If you exit the session or close Windows PowerShell, the
changes are lost. To retain these changes, you can create a Windows PowerShell
profile and add the aliases, functions, and variables to the profiles. The profile is
loaded every time that Windows PowerShell starts.
To load a profile, your Windows PowerShell execution policy must permit you to
load configuration files. If it does not, the attempt to load the profile fails and
Windows PowerShell displays an error message.
You can have four different profiles in Windows PowerShell. The profiles are listed
in load order. The most specific profiles have precedence over less specific profiles
where they apply.
%windir%\system32\WindowsPowerShell\v1.0\profile.ps1 (This profile applies to
all users and all shells.)
%windir%\system32\WindowsPowerShell\v1.0\ Microsoft.PowerShell_profile.ps
1 (This profile applies to all users, but only to the Microsoft.PowerShell shell.)
Implementation/Usage Scenarios
Command-Line Services, Processes, Registry, and WMI Data
Management
Common as-needed server administration tasks, such as identifying running services or
processes, viewing the registry, and reading and changing settings stored in Windows
Management Instrumentation (WMI), are easier than ever with the built-in command-line
tools (cmdlets) get-service, get-process, get-wmiobject, and the registry provider for
Windows PowerShell.
Server Management
Windows PowerShell allows you to manage specific Windows Server 2008 roles, such as
Active Directory, Internet Information Services (IIS) 7.0 and Terminal Server, as well as
Exchange Server 2007 and Microsoft Operations Manager 2007. In addition, a number of
partners have provided Windows PowerShell commands that improve network
management, and provide rich charting and gauge capabilities.
Terminal Server Management. Because Terminal Server stores a wealth of data in
WMI, administrators can automate Terminal Server configuration changes by means
of Windows PowerShell scripts, and examine configuration similarities and
differences across a Terminal Server farm. There are numerous script examples in
Microsofts TechNet ScriptCenter.
Internet Information Services 7.0. Windows PowerShell is ideally suited to managing
IIS 7.0, including deploying and configuring IIS 7.0 across a web farm.
The Microsoft IPMI provider and IPMI driver, allow you to obtain BMC data from
remote server computers through a standard WMI provider with WMI classes. While you
can write a normal WMI script that obtains remote data through DCOM, in many cases
the preferred method of obtaining IPMI data is through the WinRM command line utility,
the WinRM Scripting API, or WinRM C++ API.
The BMC also has an event database called the System Event Log (SEL) which records
events in the monitored computer. You cannot subscribe to have these events delivered to
a script as you can with WMI event classes. However, you can use the Wecutil.exe
command line tool to subscribe to them.
Windows Remote Management
Windows Remote Management (WinRM) is the Windows implementation of WSManagement,
an industry-standard Web services-based protocol. Windows Remote
Management provides a secure, efficient way for management applications and scripts to
communicate with local and remote computers. The Windows service that Windows
Remote Management installs and uses is called WinRM.
When a server is connected to a BMC that supports the WS-Management standard,
applications and scripts can use Windows Remote Management to communicate directly
with the BMC, even when the operating system is offline (pre-boot or post-failure).
When a server is not connected to a BMC, Windows Remote Management can still be
used to connect to WMI remotely in situations where DCOM communication is impeded
(for example, across a firewall). This is possible because the WS-Management standard is
firewall-friendly and uses a single port configurable by the system administrator.
Windows Remote Management exposes its own application programming interface (API)
for scripting, which can be used by scripts written in any Windows Script Hostcompatible
language. The scripting API communicates with WMI using syntax different
from standard WMI scripts. WinRM syntax is documented in the WinRM Software
Development Kit. Hardware Management uses a WMI plug-in to expose WMI classes to
WinRM. WS-Management is based on the following standard specifications: HTTPS,
SOAP over HTTP (WS-I profile), SOPA 1.2, WS-Addressing, ES-Transfer, WSEnumeration
and WS Eventing.
WinRM Command Line Tool (Winrm.cmd)
The command-line tool provided as the primary administrative interface for managing
WinRM is a batch file (Winrm.cmd) that runs a Visual Basic Scripting Edition
(VBScript) script named Winrm.vbs. Because it is a script, you can open it as a text file
and view the code to learn how it works. You can also write your own VBScript scripts
that take advantage of the WinRM scripting API. Winrm.vbs runs under Cscript.exe, the
command-line scripting engine of Windows Script Host.
Technical Background
Remote Management Architecture
The following components and features are supplied by WinRM and hardware
monitoring:
WinRM Scripting API. This scripting API enables you to obtain data from remote
computers using scripts that perform WS-Management protocol operations.
Winrm.cmd. This commandline tool for system management is implemented in a
Visual Basic Script file (Winrm.vbs) written using the WinRM scripting API. This
tool allows an administrator to configure WinRM and to get data or manage
resources.
Windows Server 2003 R2: For this command to work, the Hardware Management
feature had to be installed through Add/Remove System Components under
Management and Monitoring Tools in Control Panel.
Winrs.exe. This command line tool allows administrators to remotely execute most
Cmd.exe commands using the WS-Management protocol. For more information, see
the online help provided by the command line Winrs /?.
Windows Server 2003 R2: This command is not available.
Intelligent Platform Management Interface (IPMI) driver and WMI provider.
Hardware management through the Intelligent Platform Management Interface (IPMI
provider and driver allows you to control and diagnose remote server hardware
through BMCs when the operating system is not running or deployed.
WMI service. The WMI service continues to run side-by-side with WinRM and
provides requested data or control through the WMI plug-in. You can continue to
obtain data from standard WMI classes, such as Win32_Process, as well as IPMIsupplied
data.
WS-Management protocol. WS-Management protocol, a SOAP-based, firewallfriendly
protocol, was designed for systems to locate and exchange management
information. The intent of the WS-Management protocol specification is to provide
interoperability and consistency for enterprise systems that have computers running
on a variety of operating systems from different vendors.
WS-Management protocol is based on the following standard Web service
specifications: HTTPS, SOAP over HTTP (WS-I profile), SOAP 1.2, WSAddressing,
WS-Transfer, WS-Enumeration, and WS-Eventing.
Remote Management Installation
If Windows Remote Management is not installed and configured, WinRM scripts do not
run and the WinRM command line tool is unable to carry out data operations. The
Windows Remote Shell command line tool, WinRS, and event forwarding also depend on
WinRM configuration.
Default Configuration
WinRM and Intelligent Platform Management Interface (IPMI) WMI provider
components are installed by default with Windows Server 2008 and the WinRM
service starts automatically.
On Windows Vista, the service must be started manually.
On Windows Server 2003 R2, WinRM is not installed by default but is available as
the Hardware Management feature through the Add/Remove System Components
feature in the Control Panel under Management and Monitoring Tools.
By default, no WinRM listener is configured. Even if the WinRM service is running,
WS-Management protocol messages that request data cannot be received or sent.
Internet Connection Firewall (ICF) blocks access to ports.
You can use the Winrm command to locate listeners and the addresses by typing
the following command at a command prompt:
winrm e winrm/config/listener.
To check the state of configuration settings, type this command:
winrm get winrm/config.
You can either leave the default settings for client and server components of WinRM
or customize them. For example, you may need to add certain remote computers to
the client configuration TrustedHosts list.
A trusted hosts list should be set up when mutual authentication cannot be
established. Kerberos allows mutual authentication but cannot be used in
workgroups, only domains. A best practice in setting up trusted hosts for a
workgroup is that the list should be as restricted as possible.
You can create an HTTPS listener by the following command:
winrm quickconfig - transport:https.
Be aware that you must open port 443 for HTTPS transport to work.
Windows Firewall and WinRM Ports
The default listener ports configured by winrm quickconfig are port 80 for HTTP
transport and port 443 for HTTPS. If you configure a custom port for a listener, you must
open the port before WinRM can send and receive messages.
The following example uses the netsh firewall command to open port 3190 for a listener
that uses that port.
netsh firewall add portopening TCP 3190 "Port 3190"
Configuring a Proxy Server for WinRM
WinRM uses HTTP and HTTPS to send messages between the client and server
computers. By default, the WinRM client is not configured to use a proxy server and
sends messages directly to the WinRM server computer. Be aware that the WinRM client
does not use the Internet Explorer proxy settings. If a proxy is required in order to reach
the server computer, the WinRM proxy configuration can be changed by using the
ProxyCfg.exe tool.
Scripting in WinRM
The Scripting API in WinRM and the accompanying COM API for C++ are designed to
reflect closely the operations of the WS-Management protocol.
The WinRM Scripting API in Windows Remote Management supports all the WSManagement
protocol operations except one. It does not allow subscriptions to events. To
subscribe to events from the BMC System Event Log, you must use the Wecutil or
Wevtutil command-line tools.
The WinRM Scripting API is called by Winrm.vbs, a command-line tool, which is written
in Visual Basic Scripting Edition (VBScript). Winrm.vbs provides examples of how to
use the WinRM Scripting API.
Using WSman Compared to Using WMI Scripting
WMI connects to remote computers through DCOM, which requires the configuration
described in Connecting to WMI on a Remote Computer. WinRM does not use DCOM to
connect to a remote computer. Instead, the WS-Management protocol sends SOAP
messages and the service uses a single port for HTTP and a port for HTTPS transport.
Unlike the WinRM command-line tool, scripts must provide the XML required to pass to
the WS-Management protocol messages. They must also provide URIs. The WMI
Scripting API works with objects, such as instances of Win32_LogicalDisk, which
represent resources on a computer. This WMI class is defined in Managed Object Format
(MOF) files, which are stored in binary form in the WMI repository. In WMI, a Get
operation for a single resource or a query for multiple instances returns WMI objects.
A WinRM script does not return objects, but rather streams of XML text.
WinRM Script and Winrm.cmd Output
The output from a WinRM script is encoded in Unicode. If you create a FileSystemObject
and write a file from the script, the resulting file is Unicode. However, if you redirect the
output to a file, the encoding is ANSI. If you redirect the output to an XML file and there
are Unicode characters in the output, the XML will be invalid. Be aware that the winrm
command-line tool outputs ANSI.
Windows Server 2003 R2: If a WMI class name, method, or property name
contains non-ASCII characters, then the data cannot be retrieved by WinRM.
However, the instance data can contain non-ASCII characters.
Authentication for Remote Connections
Windows Remote Management maintains security for communication between
computers by supporting several standard methods of authentication and message
encryption. The default credentials, user name and password, are the credentials for the
logged-on user account that runs the script.
Kerberos. Kerberos is the default method when the client is in a domain and the
remote destination string is not one of the following: localhost, 127.0.0.1, or [::1].
Negotiate. Negotiate is the default method when the client is not in a domain.
Negotiate is also the default method when the client is in domain, but the remote
destination string is one of the following: localhost, 127.0.0.1, or [::1].
You can control the authentication method being used by WinRM:
Basic Authentication. Basic authentication is disabled in the default configuration
settings for both WinRM client and WinRM server. To explicitly establish Basic
authentication in the call to WSMan.CreateSession, set the WSManFlagUseBasic and
WSManFlagCredUserNamePassword flags in the flags parameter.
Digest Authentication. To explicitly establish Digest authentication in the call to
WSMan.CreateSession, set the WSManFlagUseDigest flag in the flags parameter.
Digest is not supported, which means it cannot be configured, for the WinRM server
component.
Negotiate Authentication. To explicitly establish Negotiate authentication, also
known as Windows Integrated Authentication, in the call to WSMan.CreateSession,
set the WSManFlagUseNegotiate flag in the flags parameter.
With Windows Server 2008 and Windows Vista, User Account Control (UAC)
affects access to the WinRM service. When Negotiate authentication is used in a
workgroup, only the built-in Administrator account can access the service. To allow
all accounts in the Administrators group to access the service, set the following
registry key to 1:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system\LocalA
ccountTokenFilterPolicy
Kerberos Authentication. To explicitly establish Kerberos authentication in the call to
WSMan, set the WSManFlagUseKerberos flag in the flags parameter. Both the client
and the server computers must be joined to a domain. If you use Kerberos as the
authentication method, you cannot use an IP address in the call to
WSMan.CreateSession or IWSMan::CreateSession.
Windows Server 2003 R2: This type of authentication is not available.
Enabling Authentication Options
The default authentication option at system installation is Kerberos.
If your script or application requires a specific authentication method that is not enabled,
you must change the configuration to allow that. This change can be made using the
Winrm command line tool or through Group Policy for the Windows Remote
Management Group Policy Object. You may also choose to disable certain methods of
authentication.
Implementation/Usage Scenarios
Windows Server 2008 administrators will have the need to manage PCs in restricted
environments, collect information for asset and configuration management, remotely
manage servers, and monitor PC health. With Windows Remote Management you can do
all of these things. You can:
Perform local and remote server management by accessing multiple data
management stores such as WMI, ADSI, COM, Certificates, Registry, and XML
configuration files.
Automate the management of local and remote servers.
Obtain management data from local and remote computers that may have baseboard
management controllers (BMCs).
Utilize WMI on Windows systems.
Utilize WS-Management Protocol for non-windows systems.
Monitor PC health by forwarding events to a central collector.