Convert AD Account property - Account Expires


hey

 i have totally lost command to  convert value example accountexpires user friendly time value. if u drop command wopuld appreciated


mcsa / mcts

in powershell 2.0, system.directoryservices.directoryentry type has a new convertlargeintegertoint64 codemethod can use this:

ps>$user = [adsi]"ldap://cn=testuser,ou=testou,dc=test,dc=local"

ps>[datetime]::fromfiletime($user.convertlargeintegertoint64($user.accountexpires[0]))

saturday, april 24, 2010 12:00:00 am





aleksandar nikolić http://powershellers.blogspot.com http://twitter.com/alexandair


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Generating Event ID 91, 44 with CA (In Event Viewer with source as Certsvc)

Windows server 2012 r2 inplace upgrade failed

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)