Saturday, March 30, 2013

Active Directory - Export Users and ListLastLogonDate to text file

Open Active Directory Module for Windows PowerShell in Administrative Tools and type the following command.


Get-ADUser -Filter * -Properties "LastLogonDate"| sort-object -property lastlogondate -descending | Format-Table -property name, lastlogondate -AutoSize | Out-File C:\Temp\ListLastLogonDate.txt

No comments: