-1

I want to know how to modify accountExpires via adsi. I find below:

when I modify time:2014/3/2 0:00:00 of accountExpires, I can find that the key of accountExpires is "130381632000000000" via ADSI.

2014/3/2 0:00:00 how to converts "130381632000000000", what is the rule for this ?

1 Answers1

2

In PowerShell:

PS C:\> [DateTime]::FromFileTime("130381632000000000")  

Saturday, March 1, 2014 11:00:00 AM  

PS C:\> [DateTime]::Parse("2014-03-01 11:00:00").ToFileTime()
130381632000000000

File Times
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724290%28v=vs.85%29.aspx

A file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC).

Greg Askew
  • 34,339
  • 3
  • 52
  • 81
  • Thanks for your nice answer, by the way, can we modify the attribute of accountExpires via ldap ? even I find that I can't search the accountExpires via ldapsearch – Kimiko Chen Mar 01 '14 at 16:34
  • You should be able to modify it as with any other writable attribute. If you cannot get the value in a query, that may be due to you are searching the global catalog, and the accountExpires attribute is not in the global catalog. – Greg Askew Mar 02 '14 at 14:59