Installing the module

  1. Download the module by clicking the Downloads tab or by clicking here https://adaudit.codeplex.com/releases
  2. Extract the downloaded ZIP file to a valid module location. You can view the valid module paths in PowerShell by running this command $env:psmodulepath -split ';'
  3. An example location would look like C:\Users\myuser\Documents\WindowsPowerShell\Modules\ADAudit

Testing the module works

  1. In a PowerShell window, type Get-Module -ListAvailable -Refresh
  2. You should see the module ADAudit listed
  3. Import the module by typing Import-Module ADAudit
  4. To view the available commands, type Get-Command -Module ADAudit

Frequently Asked Questions

How do I know the syntax for each command?

Each cmdlet has been written to fully support Get-Help within PowerShell.
So to get help for Get-ADUserLogonTimes, you would type Get-Help Get-ADUserLogonTimes.
You can also retrieve in-depth help (including Examples) by typing Get-Help Get-ADUserLogonTimes -Full

Get-HelpExample.gif

Do the cmdlets support the Verbose switch?

Yes, each cmdlet supports the -Verbose switch to display detailed information on execution. If you need more detailed debug information, try using the built-in Trace-Command cmdlet (requires PowerShell v3.0 or above)

More information: http://technet.microsoft.com/library/hh849955.aspx

Do I need the ActiveDirectory module installed to use these commands?

The ActiveDirectory module (Get-ADUser, Get-ADGroup etc) is NOT a pre-requisite to using these cmdlets. This module leverages the ADSI .NET class to interface with Active Directory, and as such only requires the standard LDAP ports to be open from the client to a valid Domain Controller.

Although the ActiveDirectory module is not a requirement to using these commands, they can still be used to compliment the ADAudit Module. For instance, the following command line would work in PowerShell:

Get-ADUser -Identity 'someuser' | Get-ADUserLogonTimes

You can find which cmdlets support this by using Get-Help cmdletname -Examples

I can't import the module into PowerShell

If you can't import the module into PowerShell, try the following troubleshooting techniques:
  • If you are being continually prompted to run scripts when importing the module, your machine doesn't trust the downloaded files. In this case do the following:
    • Delete the unzipped module folder and all of it's contents
    • Download the ZIP file from the Downloads tab again
    • Locate the ZIP file in Windows Explorer. Right-click it an select Properties
    • See if the properties window for the ZIP file has the following warning
    • Unblocking-ZIP.gif
    • If so, click Unblock, then OK and the file should now be trusted
    • Unzip the file to your modules path again. (See installation instructions at top of this page)


If you receive an error resembling 'Module not found', then try the following:
  • In PowerShell, type Get-Module -ListAvailable -Refresh
  • Look for the ADAudit module in the list
    • If it's there, double check your syntax for importing the module. It should be Import-Module ADAudit
    • If it hasn't appear, check your modules folder to see if the folder ADAudit exists
    • Inside that folder should be a series of files (psm1, psd1, ps1). Make sure these files aren't buried another level deeper in your folder structure

Can I automatically import the module whenever PowerShell is opened?

Yes. It's a simple case of adding the following line to your PowerShell Profile.

Import-Module ADAudit

To find out how to edit your PowerShell profile, see here: http://technet.microsoft.com/en-us/library/ee692764.aspx

Last edited Mar 4, 2014 at 1:04 PM by SplashtheAsh, version 4