Thursday 15 April 2021

How to Export last password date of users in an OU through powershell

How to Export last password date of users in an OU.

can you the following powersheel command 

PS C:\Windows\system32> Get-ADUser -SearchBase "OU=Users,DC=Mydomain,DC=net" -filter * -Properties * | select name, @{name ="pwdLastSet"; expression={[datetime]::FromFileTime($_.pwdLastSet)}} >c:\pic\nameAndPass.csv