Doing som scriptbuilding and came across this strange thing, and want so hear if anybody else gets this.
When running [b]Get-ADuser "username" -property pwdLastSet[/b] you get the property pwdLastSet. Take this number and run [b]Get-Date (number from pwdLastSet)[/b].
The issue here is that i get something like this back: 28.feb.0415. In my mind that is incorrect. It should have ended with 2015, not 0415. Whats going on? Anyone else getting this?
Yes, I get the same output you get when I feed that long number to Get-Date.
The number stored in AD is the miliseconds since 1/1/1600. However it looks like if you give Get-Date a long integer, it assumes that this is miliseconds since 1/1/0000. That's why the date is exactly 1600 years off.