Administration and Automation with Windows PowerShell
Course Introduction • 5min
0 / 2 lessons complete
Getting Started with Windows PowerShell • 42min
0 / 7 lessons complete
The Basics of PowerShell
Video | 7 min
Installing and Updating PowerShell
Video | 7 min
The Text Based Console Part 1- An Overview
Video | 7 min
Text Based Console Part 2 - An Overview
Video | 5 min
The ISE (Intelligent Scripting Environment) Part 1
Video | 5 min
The ISE (Intelligent Scripting Environment) Part 2
Video | 5 min
Use the OGV Command to Easily View console data!
Video | 6 min
Getting Help and Finding Commands • 39min
0 / 6 lessons complete
Getting Help and Finding Commands Part 1
Video | 7 min
Getting Help and Finding Commands Part 2
Video | 3 min
Getting Help and Finding Commands Part 3
Video | 4 min
Help System LAB Questions
Video | 6 min
Help System Lab Answers 1-4
Video | 9 min
Help System Lab Answers 5-9
Video | 10 min
PowerShell Command Syntax • 33min
0 / 5 lessons complete
Command Syntax Part 1
Video | 8 min
Command Syntax Part 2
Video | 8 min
Command Syntax Part 3
Video | 5 min
Command Syntax Lab Questions
Video | 4 min
Command Syntax Lab Answers
Video | 8 min
PowerShell Objects and Properties • 35min
0 / 6 lessons complete
Objects, Properties and Methods Part 1
Video | 3 min
Objects, Properties and Methods Part 2
Video | 8 min
Objects, Properties and Methods Part 3
Video | 7 min
Questions 1-9 for Objects, Properties and Methods
Video | 2 min
Answers to Questions 1-7 O-P-M
Video | 11 min
Answers to Questions 8,9 O-P-M
Video | 4 min
The PowerShell Pipeline • 24min
0 / 2 lessons complete
PowerShell Providers • 30min
0 / 5 lessons complete
What are PowerShell Providers
Video | 3 min
Using PS Drive
Video | 6 min
PowerShell Provider CMDlets -1
Video | 12 min
PowerShell Providers CMDlets -2
Video | 7 min
Student Assignments
Text | 2 min
PowerShell Arrays and Variables • 28min
0 / 4 lessons complete
PowerShell Variables
Video | 9 min
PowerShell Arrays
Video | 12 min
PowerShell Variables Challenge
Video | 2 min
PowerShell Variables Solution
Video | 5 min
PowerShell Loops • 19min
0 / 3 lessons complete
PowerShell Conditional Statements • 11min
0 / 1 lessons complete
On Premises Lab Setup • 36min
0 / 8 lessons complete
Should You Watch This Section?
Video | 2 min
Downloading and Installing VirtualBox
Video | 2 min
Downloading Windows Server 2019
Video | 3 min
Creating Your Virtual Network
Video | 2 min
Creating Your Virtual Machines
Video | 7 min
Installing VirtualBox Guest Additions
Video | 2 min
Installing Windows Server
Video | 8 min
Installing the Active Directory Domain Services Role
Video | 10 min
Basic Domain Administration with Windows PowerShell • 2hr 27min
0 / 10 lessons complete
Configuring PowerShell Execution Policy with Group Policy
Video | 13 min
Installing Windows Server Roles and Features with Powershell
Video | 6 min
Running Powershell Scripts as Scheduled Tasks
Video | 8 min
Creating Organizational Units with Powershell
Video | 11 min
Creating and Managing Active Directory User Accounts with PowerShell
Video | 19 min
Move all AD Users in a Group to a Specific Organizational Unit
Video | 7 min
Generate a list of AD Users and their OU
Video | 5 min
PowerShell Splatting
Video | 5 min
Bulk Install Windows MSU Files Automatically with PowerShell
Video | 13 min
Lab: Domain Administration with Windows PowerShell
Lab | 60 min
Send Emails with PowerShell • 22min
0 / 2 lessons complete
Send Emails from Gmail with PowerShell
Video | 9 min
Create Password Expiration Notification Script
Video | 13 min
PowerShell Desired State Configuration (DSC) Basics • 1hr 48min
0 / 6 lessons complete
DSC Overview
Video | 9 min
Enabling PSRemoting with Group Policy
Video | 9 min
The DSC Resource Kit
Video | 7 min
Configuring The Local Config Manager for DSC Push
Free lesson
Video | 14 min
Uninstalling Windows Features with DSC
Video | 9 min
Lab: Desired State Configuration (DSC)
Lab | 60 min
Course Conclusion • 1min
0 / 1 lessons complete
Sign up to access this lesson
Click here to sign up and get access to this lesson!

Saving Progress...
Creating Organizational Units with Powershell
In this lecture, we are going to learn how to create Active Directory Organizational Units with Windows PowerShell.
Now, first just a quick reminder. The way you would do it using the Graphical User Interface is by clicking Tools here in the upper right-hand corner of Server Manager and selecting Active Directory Users and Computers.

Then we select the desired location and choose New > Organizational Unit.

And we make some kind of name like Test123 and you can uncheck Protect container from accidental deletion and click OK.

And there is our Organizational Unit Test123 and it has been created under instructorpaul.com.

So, we are going to learn how to do this in PowerShell.
I am going to go ahead and delete that Organizational Unit and launch PowerShell as Administrator.

Click Yes on the User Account Control window.

First, before we create the Organizational Unit let’s learn how to list or get our Organizational Units.
We are going to type Get-ADOrganizationalUnit and press Enter.
What it did right there is that it Imported the Active Directory module for us.
Now is asking us to type in a Filter. We are just going to type in a * and press Enter.
It has output every single Organizational Unit that it is inside of our Active Directory.

This is not a human-readable format or an easy-to-understand output since it is kind of split up. You can work with it if you wanted to but what we are going to do is format this in a table format with the command Get-ADOrganizationalUnit | Format-Table and choose what objects we want to include.
I am going to include the following Get-ADOrganizationalUnit | Format-Table Name, DistinguishedName, and press Enter. For the Filter, I will enter a * and press Enter.
Now, this is much easier to see the display of results.

So, one thing that we can also do to make our lives a little bit easier is to use the following command: Get-ADOrganizationalUnit -filter “*” | Format-Table Name, DistinguishedName and press Enter.
So, we are saying get every Organizational Unit immediately.

So, what we are doing is streamline and make it faster so we don’t have to enter the second input as at the command prompt.
Now, let’s talk about, how do you search for a specific Organizational Unit?
Let’s say for example, how do you find all the Organizational Units that are directly beneath the InstructorPaul Organizational Unit?
And, The way you can do that is by typing: Get-ADOrganizationalUnit -filter “*” -SearchBase “OU=InstructorPaul,DC=instructorpaul,DC=com” | Format-Table Name, DistinguishedName and press Enter.
This is going to list every Organizational Unit under InstructorPaul.

Now, it is important to keep in mind that this is getting every Organizational Unit under InstructorPaul and there’s a couple of nested OUs under this.
So, if I just want to grab the first level or every Organizational Unit that is directly beneath InstructorPaul I can do that by adding yet another argument like the following: Get-ADOrganizationalUnit -filter “*” -SearchBase “OU=InstructorPaul,DC=instructorpaul,DC=com” -SearchScope OneLevel | Format-Table Name, DistinguishedName, and press Enter.
This gets the first level Organizational Units right under InstructorPaul.

Now, if I open Active Directory Users and Computers and expand instructorpaul.com > InstructorPaul I can see I have Domain Users, Domain Workstations, and member Servers.

And in this last PowerShell command prompt, I also have Domain Users, Domain Workstations, and member Servers.

OK, let’s say we want to create a new Organizational Unit under the InstructorPaul OU.
You can do that by just simply typing New-ADOrganizationalUnit -Name “Test123” and pressing Enter.

Now, by default, it will go under the root of our directory so if I refresh the Active Directory Users and Computers I now have Test123 which was created a second ago.
Sign up to access the rest of this lesson
You must either log in or sign up to access this lesson.

Saving Progress...