Export-LastLogonTime

1.5

Export-LastLogonTime takes the OU name or distinguished name specified in the OU parameter and retrieves its users' account names and last logon times.  Then it exports a .csv file to the destination given in the Destination parameter.  This command will search the entire domain for the OU name specified.  If the destination path contains spaces it must be wrapped in
Export-LastLogonTime takes the OU name or distinguished name specified in the OU parameter and retrieves its users' account names and last logon times.  Then it exports a .csv file to the destination given in the Destination parameter.  This command will search the entire domain for the OU name specified.  If the destination path contains spaces it must be wrapped in quotation marks, and the file name specified must end in .csv.

Due to the fact that the LastLogonDate does not replicate between domain controllers, this script will search for domain controllers and compare the LastLogonDate from each one to find the most recent time a user logged in unless specific Domain Controllers are specified to the Server parameter.

While available, supplying specific Domain Controllers to the Server parameter is discouraged because there is a possibility they will not be correct due to the reason described above.
Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name Export-LastLogonTime -RequiredVersion 1.5

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

2016 Chris Carter

Package Details

Author(s)

  • Chris Carter

Tags

ActiveDirectory LastLogonTime

Functions

Test-Module Get-LogonTimes

Dependencies

This script has no dependencies.

Release Notes

The Server parameter was added to specify which Domain Controller(s) to use when checking the logon times. The switch parameters NoClobber and Force were added for improved control over file overwrites. Help data was updated with new information, and minor errors corrected.

FileList

Version History

Version Downloads Last updated
1.6.4 794 11/28/2018
1.6.3 480 6/27/2017
1.5 (current version) 255 6/16/2016
1.4 72 4/14/2016
1.3.1 26 4/5/2016
1.2 35 3/7/2016
Show less