From the course: Advanced PowerShell: Automating Active Directory Administration

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Generating custom reports

Generating custom reports

- [Instructor] We're all aware of some of the common reporting types of PowerShell cmdlets. Now, let's put some of those into a script, and then we can run that script to export the results for our annual audit. So, I'm going to start by importing the module for active directory. So, I'll type in "import-module activedirectory". Now, the reason I'm typing this as the first one is, I don't know if this is going to be run on the domain controller. If it is, it won't cause any harm by typing it, and if it's not, it will go ahead and add it, so that way, the next cmdlets will actually work. The next line, line two, is basically just a remark to tell us what line three is going to be. And I like to do this, and I recommend for you to do it also, so give it a test, to make sure that you understand what it is that each cmdlet does. So, in this case, you can see it's a variable because it starts with a dollar sign, it doesn't…

Contents