Link to home
Create AccountLog in
Avatar of E=mc2
E=mc2Flag for Canada

asked on

Modify Powershell AD script to include Last Login

I would l like to modify this script to also include the Last Login.


Get-ADUser -Filter * -Property PasswordLastSet -ResultSetSize $null |
   Select-Object -Property SamAccountName, @{n='PasswordLastSet'; e={If ($_.PasswordLastSet) {$_.PasswordLastSet} Else {'<never>'}}}, DistinguishedName |
   Export-Csv -NoTypeInformation -Path C:\Temp\PwdLastSet.csv

Open in new window


ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account