From the course: PowerShell: Automating Administration

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use logic tests in scripts

Use logic tests in scripts - Server Tutorial

From the course: PowerShell: Automating Administration

Start my 1-month free trial

Use logic tests in scripts

- [Instructor] The primary goal of this course is automating administration. By definition, automation removes the need for human interaction as much as possible. So let's consider the things that might not happen if you aren't there to oversee the process. One of the first things that comes to mind is the preflight checklist. For example, when we create a batch of users, we check to see that we have a list of users to create and a location in Active Directory where the users will be created. We would normally check to see that these conditions were met before we begin. Sometimes the things that we check are comparisons rather than simple pass-fail tests. For example, we might look at user-password expiration dates and take action on accounts where the date is less than three days away. Well in scripts designed to automate administrative tasks, there are a lot of opportunities to use a logical test to determine the appropriate steps. Let's take the first idea of creating a batch of…

Contents