Try:

$user = get-aduser -id userid -properties accountexpirationdate

(get-date $user. Accountexpirationdate -f d)

Webster

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Kurt Buff
Sent: Monday, March 02, 2015 7:49 PM
To: [email protected]
Subject: [powershell] Date output format

When I run the following:

get-aduser -id userid -properties accountexpirationdate

or similar, I see that the date output is in the form of "2/27/2015 5:00:00 PM".

This, in spite of the fact that my machine settings are for
"2015-02-27 17:00:00".

Is that because the DCs aren't set the same as my computer, or is it internal 
to AD, or something else? And can I put something in my profile at least to 
adjust that?

Kurt


================================================
Did you know you can also post and find answers on PowerShell in the forums?
http://www.myitforum.com/forums/default.asp?catApp=1


================================================
Did you know you can also post and find answers on PowerShell in the forums?
http://www.myitforum.com/forums/default.asp?catApp=1

Reply via email to