I want to check the PasswordLastSet value of the user is that empty.
PS Z:\> Get-ADUser -Identity test1 -Properties * | select passwordlastset
passwordlastset
---------------
By if to judgment is that null.
this is my script
$password = Get-ADUser -Identity test1 -Properties * | select passwordlastset
if ($password -ne $null){
Write-Output "It's empty"
}
else {
Write-Output "It isn't empty"
}
That always output "It's empty"
what should I do? How to change it?