I'm building a script that makes 4 lists: AD users and computers who've been inactive for x days and users and computers who've been disabled for x days.
I already have such a script in vbscript but currently I'm rewriting it in Powershell and my results are different regarding "users and computers who've been disabled for x days".
I've used Search-ADAccount to find my results. It turns out that the returned values for LastModifiedDate are not correct. (which I use to check the "days disabled"-value). I've built a command with Get-ADUser which should returns the same dataset. That resultset does have the correct values for LastModifiedDate.
So I'll rewrite my script to use Get-ADUser and Get-ADComputer and not search-adaccount. But I'd like to know why it's different. It also doesn't matter if I run it on my workstation or on a server. (so it's not a client-issue).