May 2007
Beginner
320 pages
8h 23m
English
In this exercise, we will explore the use of a text file to hold the name of multiple OUs we wish to create in Active Directory.
Open Notepad or some other script editor.
Locate the StepByStep.txt file (this contains the list of OUs your script will create) in the Chapter 7 folder. Make sure you have the exact path to this file. On the first line of your script, create a variable called $aryText. Use this variable to hold the object that is returned by the Get-Content cmdlet. Specify the path to the StepByStep.txt file as the value of the path argument. The line of code that does this is shown here:
$aryText = Get-Content -Path "c:\labs\ch7\stepbystep.txt"
When the Get-Content cmdlet is ...
Read now
Unlock full access