This is all done via Get-ADUser
help Get-ADUser
Get-ADUser -identity username -properties *
get-aduser -filter * -properties passwordlastset, passwordneverexpires |ft Name, passwordlastset, Passwordneverexpires
With that in mind, lets see a script that exports all data to a CSV while also sorting the objects by Name:
Get-ADUser -filter * -properties passwordlastset, passwordneverexpires | sort-object name | select-object Name, passwordlastset, passwordneverexpires | Export-csv -path C:\Temp\AD-Report.csv