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

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607