![](//vs1.manuzoid.com/store/data-gzf/23fd3624457974c560d8c813cb87c8ea/2/000373439.htmlex.zip/bg4.jpg)
CHAPTER 1
ince the dawn of the information technology age, administrators have been
continually searching for ways to make their jobs easier. Rather than spending time
performing the same or similar tasks repeatedly, many administrators have taken to
adopting some form of automation. roughout the years, you’ve witnessed many
advances in automation, from the early days of DOS batch les to VBScripts and
Windows Management Instrumentation (WMI). ese advances come out of the
desire for things to happen on their own—to use the computing power available at
the ngertips of administrators to make their lives easier.
e next generation of automation technology was o cially released for Windows
environments in 2006. PowerShell (formerly referred to as Monad in the beta release
years) promised to deliver an extremely powerful and exible scripting environ-
ment complete with access to standard object models and programming interfaces.
PowerShell has certainly lived up to the promise over the years, but adoption by
Microso products has been slow. Until Windows Server 2008 R2, there was no
out-of-the-box PowerShell extension for Active Directory. However, the adoption of
PowerShell has now become mainstream, and Active Directory has a built-in
module for PowerShell. In this chapter, you’ll learn the basics of PowerShell and
understand how Active Directory and PowerShell work together.
Understand the Basics of PowerShell
PowerShell version 1 debuted as a web download and as part of Windows 2008,
although you had to install it through the Add Features Wizard in the Server
Manager. PowerShell v2 is installed by default in Windows Server 2008 R2. At its
core, PowerShell is a command interpreter. Much as with the command prompt,
you type in a command and press Enter, and the command executes. But beyond
that, PowerShell has some amazing scripting capabilities that really take it to the
next level in terms of administrative usefulness. Because of this, it’s becoming
increasingly more common to see people replacing the command prompt with
PowerShell. In fact, most of the things that you can do at a command prompt can
be done by default with PowerShell using the same commands. Figure 1.1 shows a
comparison of the
dir
command run in a traditional command prompt (top) and
PowerShell (bottom).
One of the things you’ll notice in Figure 1.1 is that the information PowerShell
exposes by default looks more structured. e entries in the output have headings
attached to them, similar to how a spreadsheet might look. is is because PowerShell
isn’t a text-based command interpreter like the Windows command prompt and other
command shells. Standard text-based interpreters can take a text string as input and
S
c01.indd 4c01.indd 4 5/12/2011 1:07:37 PM5/12/2011 1:07:37 PM