Tag Archives: [System.DateTime]

New article on PowerShell Magazine: Working with [DateTime] Class

My brief article on working with the [System.DateTime] .Net Class has been posted on PowerShell Magazine. It contains some quick tips on how to utilize this class to work with DateTime objects and how to convert strings to a DateTime object.

For example when converting the ‘accountexpires’ property of an AD account. This can be done as follows:

$Expires = ([adsisearcher]'(samaccountname=jaapbrasser)').FindOne().Properties['accountExpires']

For more tips regarding this topic, please refer to the article on PowerShell Magazine: