Installing the module
- Download the module by clicking the Downloads tab or by clicking here https://adaudit.codeplex.com/releases
- 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 ';'
- An example location would look like C:\Users\myuser\Documents\WindowsPowerShell\Modules\ADAudit
Testing the module works
- In a PowerShell window, type Get-Module -ListAvailable -Refresh
- You should see the module ADAudit listed
- Import the module by typing Import-Module ADAudit
- 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
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-ADUserLogonTimesYou 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

- 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 ADAuditTo find out how to edit your PowerShell profile, see here:
http://technet.microsoft.com/en-us/library/ee692764.aspx