Reputation: 11201
I have the following code that compares two dates. Is it possible to ignore the time that comes with $ExpirationDate
and $EndDate
?
if(((get-date $ExpirationDate).Date -gt (get-date $EndDate).Date) -And $userAccountControl -eq "512")
Upvotes: 2
Views: 8982
Reputation: 11201
I added elseif
for AD account status 544 and that fixed the issue.
elseif(((get-date $ExpirationDate).Date -gt (get-date $EndDate).Date) -And $userAccountControl -eq "544")
Upvotes: 2