PasswordLastSet value is not showing in below script
hi
i running below script inactive users while trying "pwdlastset" attribute, not showing value.
please me it.
import-module activedirectory
search-adaccount -accountinactive -usersonly -datetime (get-date).addmonths(-14) | {$_.samaccountname -like "d00*" -and $_.enabled}| selectname,samaccountname,lastlogondate,passwordlastset | export-csv c:\inactive.csv -notypeinformation
the search-adaccount not return value passwordlastset seems.
try piping get-aduser this:
search-adaccount -accountinactive -usersonly -datetime (get-date).addmonths(-14) | {$_.samaccountname -like "d00*" -and $_.enabled} | get-aduser -properties passwordlastset, lastlogondate | select name,samaccountname,lastlogondate,passwordlastset | export-csv c:\inactive.csv -notypeinformation
Windows Server > Windows PowerShell
Comments
Post a Comment