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

Remote Desktop App - Error 0x207 or 0x607

AD Replication Failure Between Server 2008 R2 and Server 2003 - LDAP bind failed with error 8341