Hi all,
I want to convert the result “accountExpires” returned from Get-ADComputer to human readable format
I google the answers, but none of them works for me, I tried below way, but it doesn’t work.
$mytime=(Get-ADComputer -Identity xxxxxxYYVV -Properties accountExpires).accountExpires
$myconvert=[DateTime]::FromFileTime($mytime)
it shows me below error:
Exception calling "FromFileTime" with "1" argument(s): "Not a valid Win32 FileTime.
Parameter name: fileTime"
At line:1 char:1
+ $myconvert=[DateTime]::FromFileTime($mytime)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentOutOfRangeException
I also want to implement it with just one cmdlet, something like this:
Get-ADComputer -Identity xxxxxxxYYVV -Properties accountExpires FOLLOW SOME MAGIC
Any one can help ?