Chapter 4: Automating Active Directory Domain Services Administration
Chapter 4: Automating Active Directory Domain Services Administration
Chapter 4: Automating Active Directory Domain Services Administration
-0-
Windows Platform - CH 4
-1-
Windows Platform - CH 4
Module Overview
Using Command-line Tools for Administration
Using Windows PowerShell for Administration
Performing Bulk Operations with Windows PowerShell
-2-
Windows Platform - CH 4
-3-
Windows Platform - CH 4
What Is Csvde?
-4-
Windows Platform - CH 4
What Is Ldifde?
-5-
Windows Platform - CH 4
-6-
Windows Platform - CH 4
-7-
Windows Platform - CH 4
-8-
Windows Platform - CH 4
Test-ComputerSecureChannel -Repair
-9-
Windows Platform - CH 4
- 10 -
Windows Platform - CH 4
- 11 -
Windows Platform - CH 4
- 12 -
Windows Platform - CH 4
Operator Description
-eq Equal to
-ne Not equal to
-lt Less than
-le Less than or equal to
-gt Greater than
-ge Greater than or equal to
-like Uses wildcards for pattern matching
- 13 -
Windows Platform - CH 4
FirstName,LastName,Department
Greg,Guzik,IT
Robin,Young,Research
Qiong,Wu,Marketing
A foreach loop processes the contents of a .csv that have been imported into a
variable
$users=Import-CSV C:\users.csv
Foreach ($i in $users) {
Write-Host “The first name is: $i.FirstName”
}
- 14 -
Windows Platform - CH 4
- 15 -
Windows Platform - CH 4
Module_04
Question: What criteria would you use to select between using csvde, ldifde, and the
DS commands?
Answer: If you are using a data source that can export as a .csv file, you would
most likely use csvde. However, csvde cannot modify existing objects. You are also
likely to use csvde when exporting data from AD DS.
If you are using a data source that can export as an LDIF file, then you would most
likely use ldifde. You would also use ldifde if you need to remove or modify existing
objects.
If you are modifying individual objects, then you will most likely use the DS
commands if you have chosen not to use graphical tools.
Question: Are the parameters for all cmdlets that you use to manage user accounts
the same?
Answer: No. Many of the parameters are the same or similar, but each cmdlet has
its own list of parameters.
Question: What is the difference between using –eq and –like when comparing
strings?
Answer: The –eq operator is used to find an exact match, meaning that it is not case
sensitive. The –like operator can be used with wildcards to find partial matches.
Question: Which attributes of a user account can you use when creating a query by
using the Filter parameter?
Answer: You can use any user account parameter that you can query. Use the
Properties parameter with a value of * (-Properties *) to identify all properties that
can be retrieved.
- 16 -
Windows Platform - CH 4
Question: By default, are new user accounts enabled or disabled when you create
them by using the New-ADUser cmdlet?
Answer: By default, new user accounts are disabled when you create them by using
the New-ADUser cmdlet.
- 17 -
Windows Platform - CH 4
Question: You are an administrator for a school district that creates 20,000 new user
accounts for students each year. The administration system for students can
generate a list of the new students and then export it as a .csv file. After the data
has been exported to a .csv file, what information do you need to work with the data
in a script?
Answer: To work with a .csv file, you need to know the name and location of the
.csv file. This information allows you to import the .csv file into a variable. You also
need to know the name of each column in the .csv file. If there is no header row
with column names, then you need to create one.
- 18 -