Administering Service DeliveryPART I XCHAPTER 1 USING POWERSHELL WITH ACTIVE DIRECTORY 03 XCHAPTER 2 MANAGING DOMAIN AND FORESTS 55 XCHAPTER 3
10 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYProfile Scripts e PowerShell pro le is really a script that runs automatically when you o
UNDERSTAND THE BASICS OF POWERSHELL 11Administering Service DeliveryPART Iby PowerShell to ensure that only trusted scripts are run. You’ll learn h
12 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYCmdlets are precompiled and can be run from the PowerShell command interpreter directly or b
UNDERSTAND THE BASICS OF POWERSHELL 13Administering Service DeliveryPART Iexample, if you want to get information about a speci c service on your
14 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYEach cmdlet has a di erent set of parameters that it recognizes. e -ComputerName paramete
UNDERSTAND THE BASICS OF POWERSHELL 15Administering Service DeliveryPART IName Description-OutVariableSpecifi es a variable to which you want to wri
16 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYString Cmdlets TogetherWhen used alone, a cmdlet can be a powerful tool. However, you can us
UNDERSTAND THE BASICS OF POWERSHELL 17Administering Service DeliveryPART IFIGURE 1.8 The output of the Get-Help cmdletVarious types of help are av
18 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYTABLE 1.3 Parameters for the Get-Help CmdletParameter Description-ExamplesDisplays various
UNDERSTAND THE BASICS OF POWERSHELL 19Administering Service DeliveryPART Iprompt to your command that requires additional input by the executor bef
c01.indd 2c01.indd 2 5/12/2011 1:07:37 PM5/12/2011 1:07:37 PM
20 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYWhen you’re done creating your script, save it with a .ps1 extension, and the script will be
UNDERSTAND THE BASICS OF POWERSHELL 21Administering Service DeliveryPART IIf you’re running scripts that you wrote for computer administration, the
22 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYher private key. Bob doesn’t manually validate Alice’s script against her public key, howeve
UNDERSTAND THE BASICS OF POWERSHELL 23Administering Service DeliveryPART Ifrom http://msdn.microsoft.com/en-us/windows/bb980924.aspx. A er you ins
24 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYNOTE Some other development languages require you to defi ne what kind of data your variable
UNDERSTAND THE BASICS OF POWERSHELL 25Administering Service DeliveryPART IFIGURE 1.10 Listing the currently used variablesIn addition to variables
26 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYAdd Logic to a ScriptLogic allows your scripts to do things to the variables you’re using an
UNDERSTAND THE BASICS OF POWERSHELL 27Administering Service DeliveryPART IIf you were to run this code in a PowerShell script, the output would rea
28 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYstatement can either end or test to see if something else is true. For example, con-sider th
UNDERSTAND THE BASICS OF POWERSHELL 29Administering Service DeliveryPART ITABLE 1.6 PowerShell Comparison OperatorsComparison OperatorDescription
CHAPTER 1Using PowerShell with Active DirectoryIN THIS CHAPTER, YOU WILL LEARN TO: XUNDERSTAND THE BASICS OF POWERSHELL 4Use the Shell . . . . . .
30 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYAccept Script ParametersWhen you write a PowerShell script, there are times when you may wan
UNDERSTAND THE BASICS OF POWERSHELL 31Administering Service DeliveryPART I is speci es that the script will accept a string parameter called -Fir
32 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYTABLE 1.7 Parameter PropertiesProperty Name PurposeMandatoryA Boolean property that determin
UNDERSTAND THE BASICS OF POWERSHELL 33Administering Service DeliveryPART IFor example, if you were to create a function called DisplayMessage that
34 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYCall FunctionsIf you want to use a function that you’ve de ned in your script, you have to
UNDERSTAND THE BASICS OF POWERSHELL 35Administering Service DeliveryPART IRun a Script Outside of PowerShellWhen you write a .ps1 script, you can r
36 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYTo change the .ps1 le association, do the following: 1. Open the Control Panel, and run
UNDERSTAND THE BASICS OF POWERSHELL 37Administering Service DeliveryPART ISchedule a Script to Run AutomaticallySometimes you’ll want to create a s
38 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYFIGURE 1.13 Selecting the appropriate permissions for scheduling a script 5. Click the Ac
UNDERSTAND HOW POWERSHELL AND ACTIVE DIRECTORY WORK TOGETHER 39Administering Service DeliveryPART IFIGURE 1.14 Selecting the appropriate action fo
CHAPTER 1ince the dawn of the information technology age, administrators have been continually searching for ways to make their jobs easier. Rather th
40 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYUse the Active Directory Services InterfacePrior to Windows Server 2008 R2, if you wanted to
UNDERSTAND HOW POWERSHELL AND ACTIVE DIRECTORY WORK TOGETHER 41Administering Service DeliveryPART Ifact, if you pipe the user object into the Get-M
42 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYuserAccountControl Property System.DirectoryServices.PropertyValu...uSNChanged
UNDERSTAND HOW POWERSHELL AND ACTIVE DIRECTORY WORK TOGETHER 43Administering Service DeliveryPART IA er you bind to the container, you can create
44 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYUse the Active Directory Module e Active Directory module for PowerShell is a new feature
UNDERSTAND HOW POWERSHELL AND ACTIVE DIRECTORY WORK TOGETHER 45Administering Service DeliveryPART IAs mentioned earlier, the AD PowerShell module r
46 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYGet-ADRootDSEGet-ADServiceAccountGet-ADUserRemove-ADComputerRemove-ADComputerServiceAccountR
UNDERSTAND HOW POWERSHELL AND ACTIVE DIRECTORY WORK TOGETHER 47Administering Service DeliveryPART IUse the Active Directory DriveIn addition to pro
48 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYInfrastructure infrastructureUpdate CN=Infrastructure,DC=contoso,DC=comJenny Smith
UNDERSTAND HOW POWERSHELL AND ACTIVE DIRECTORY WORK TOGETHER 49Administering Service DeliveryPART I“Con guring Active Directory Dependencies,” we’
UNDERSTAND THE BASICS OF POWERSHELL 5Administering Service DeliveryPART Ireturn a text string as output. PowerShell is based on the .NET Framework.
50 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORY is example connects to the root\cimv2 namespace and uses the class StdRegProv, which prov
UNDERSTAND HOW POWERSHELL AND ACTIVE DIRECTORY WORK TOGETHER 51Administering Service DeliveryPART Imay encounter is that if there is a rewall bet
52 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORY FIGURE 1.15 ADWS Running on a Windows 2003 domain controllerUse Windows 7 or Windows Serv
UNDERSTAND HOW POWERSHELL AND ACTIVE DIRECTORY WORK TOGETHER 53Administering Service DeliveryPART IWindows 7 doesn’t include the RSAT feature by de
54 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORY 3. Export the AD cmdlets from the remote session into a local copy of the module. e fo
6 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYUse the Shell e shell is the primary way that you’ll interact with PowerShell. e shell i
UNDERSTAND THE BASICS OF POWERSHELL 7Administering Service DeliveryPART IYou can use the right arrow key to retype the previous command one charact
8 CHAPTER 1 • USING POWERSHELL WITH ACTIVE DIRECTORYUse the Scripting EnvironmentPowerShell 2.0 provides a new Integrated Scripting Environment (
UNDERSTAND THE BASICS OF POWERSHELL 9Administering Service DeliveryPART IFIGURE 1.4 The PowerShell Integrated Scripting EnvironmentScript editorCo
Comments to this Manuals