Link to home
Start Free TrialLog 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
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial