Datasheet

6 CHAPTER 1
USING POWERSHELL WITH ACTIVE DIRECTORY
Use the Shell
e shell is the primary way that you’ll interact with PowerShell.  e shell is very
similar to the Windows command prompt. You can type in commands and have
some output returned to you. You can launch the shell by clicking the Start menu
and selecting All Programs
Accessories
Windows PowerShell
Windows
PowerShell. If you’re on a 64-bit operating system, then you may notice that there are
two PowerShell options: Windows PowerShell and Windows PowerShell (x86).  e
x86 version is the 32-bit version of PowerShell. Unless you need to run a command
in a 32-bit environment, we recommend using the 64-bit version of the shell.  is
will allow you to use additional memory beyond 4 GB if you’re caching lots of data in
the shell. And with Active Directory, this could actually be a possibility if you have
a large forest. In Windows Server 2008 R2, PowerShell is pinned to the taskbar by
default, so you can launch it by clicking the PowerShell icon. You can also choose to
launch it by typing
powershell.exe
in the Run dialog or at the command prompt.
Sometimes, you’ll have to launch PowerShell in administrator mode.  is may be
required when you’re making system-level changes through PowerShell. To use
PowerShell in administrator mode, you can right-click the PowerShell executable and
select Run As Administrator from the menu. Depending on your system’s con guration,
you may be prompted with a User Account Control dialog. If you’re prompted, click Yes
to continue.  e shell will launch, and it will look similar to the window in Figure 1.2.
FIGURE 1.2 The PowerShell shell
When you’re working with the shell, you can use some shortcuts to make your job
easier. Each command that you type in is kept in memory.  erefore, you can cycle
through commands that you typed earlier by using the up and down arrow keys.
c01.indd 6c01.indd 6 5/12/2011 1:07:40 PM5/12/2011 1:07:40 PM