TIP: Active Directory Module Date Properties - Tech Wizard
Maybe your like
We have seen, it is very easy to get values like password expiration, when created and other such values utilizing Quest Active directory Module.

You can see above; how easy it is to get this information from the Quest AD module but what about if you want the same information from Microsoft Active Directory Module.
When you do the same with AD module, whenCreated is fine but other values such as accountexpires and pwdlastset is not friendly date format.
get-aduser testuser -Properties whenCreated,accountExpires,pwdLastSet | Select Name, whenCreated,accountExpires,pwdLastSet

There are different ways to get different things in this module:
For Account Expiry Date parameter that can be used is àAccountExpirationDate
get-aduser testuser -Properties whenCreated,accountExpirationdate | select Name, whenCreated,accountExpirationdate

For user password expiry date à @{N=”PasswordExpiryDate”;E={[datetime]::FromFileTime($_.”msDS-UserPasswordExpiryTimeComputed”)}}

For user pwdLastSet à @{N=”pwdLastSet”;E={[datetime]::FromFileTimeUtc($_.pwdLastSet)}}
get-aduser testuser -Properties whenCreated,accountExpires,pwdLastSet | select @{N=”pwdLastSet”;E={[datetime]::FromFileTimeUtc($_.pwdLastSet)}}

You can do the same with account expires property as well à @{N=”accountexpires”;E={[datetime]::FromFileTime($_.accountexpires)}}
get-aduser testuser1 -Properties whenCreated,accountExpires | select Name, Whencreated, @{N=”accountexpires”;E={[datetime]::FromFileTime($_.accountexpires)}}

I hope this TIP will help you in your day-to-day AD work.
Thanks for reading…..
Tech Wizard
https://techwizard.cloud
https://syscloudpro.com/
PowerShell Fast Track
Share this:
- X
Tag » Active Directory Pwdlastset Convert To Date Excel
-
How To Convert Active Directory Timestamp To Date In Excel (4 ...
-
Active Directory: LastLogonTimeStamp Conversion - TechNet Articles
-
Converting AD Field 'lastLogon' To Date & Time - Excel Help Forum
-
Calculating A Date From An Active Directory Value
-
How To Convert Active Directory TimeStamp Property To DateTime
-
Convert Active Directory Timestamp - Nintex Community
-
Efficiently Converting Pwdlastset To Datetime In A Single Line.
-
[PDF] Converting Ldap (activedirectory) - Dates - HeelpBook
-
Thread: Help With Converting AD Dates To Readable Formats
-
C# - How To Convert Active Directory PwdLastSet To Date/Time
-
Active Directory Date Conversion - ACL Partner Community
-
LDAP, Active Directory & Filetime Timestamp Converter
-
HOW TO: Convert Date/time Or String To LDAP Date Format And Vice ...
-
Export Gives Numerical Format Instead Of Date - Spiceworks Community