Export-LastLogonTime
1.6.3
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. This will be the time reported in the CSV file, and a column named DomainController will contain the Domain Controller the time came from 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.
The Property and SortBy parameters can be used to specify what properties will be exported to the CSV file, and how the users are sorted, but the properties LastLogonDate and DomainController will always be present.
Installation Options
Owners
Copyright
©2013-2017 Chris Carter
Package Details
Author(s)
- Chris Carter
Tags
ActiveDirectory LastLogonTime LastLogonDate
Functions
Dependencies
This script has no dependencies.
Release Notes
Most importantly, the Destination parameter was renamed to the Path parameter to bring it inline with other Export-* commands, but Destination can still be used as an alias to avoid breaking older code. Also, the Property, SortBy, and Descending parameters were added. The Property parameter is used to choose which properties are exported to the CSV file. The SortBy parameter was added due to a user request over at the PowerShell Gallery, and is used to specify which columns to sort on when exporting the objects. The Descending parameter is used to sort the objects into descending order. Due to the addition of the new parameters, the default output has been changed, and the DisplayName property is no longer included in the default output. This update also contains a fix for a bug that occurred when running the command against only one Domain Controller. This was happening because a one item array was incorrectly being converted into the item itself.
FileList
- Export-LastLogonTime.nuspec
- Export-LastLogonTime.ps1