One Step Further: Controlling How a Script Executes Against Active Directory

In this exercise, we will control the way we return data from Active Directory.

  1. To make it easier to keep up the number of users returned from our Active Directory queries, run the DeleteMultipleUsers.ps1 script. This will delete the 60 users we created for the previous step-by-step exercise.

  2. Run the Create2000Users.ps1 script. This script will create 2000 users for you to use in the MyTestOU OU.

  3. Open the QueryUsersStepbyStep.ps1 script and save it as yournameOneStepFurther-QueryUsers.ps1.

  4. Because we are not interested in running finely crafted queries in this exercise (rather, we are interested in how to handle large amounts of objects that come back), delete all the $strFilter ...

Get Microsoft® Windows PowerShell™ Step By Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.