note 57855 added to ref.ldap
| From: | christopherbyrne at hotmail dot com | Date: | Sun, 16 Oct 2005 23:32:39 +0000 |
| Subject: | note 57855 added to ref.ldap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-97097@lists.php.net to get a copy of this message | ||
For anyone who's been having trouble working with the "accountexpires" attribute in
Active Directory after having read the following article
www.microsoft.com/technet/scriptcenter/
resources/qanda/sept05/hey0902.mspx
or something similar, this may save you some frustration. In the article is is mentioned that this
attribute is an integer representing the number of nanoseconds since 01-Jan-1601 00:00:00.
However the "accountexpires" attribute actually seems to be the number of 100 nanosecond
increments since 31-Dec-1600 14:00:00. As a result if you divide the integer by 10,000,000 and
subtract 11644560000 you will get a Unix timestamp that will match the dates in AD.
To set the "accountexpires" date just reverse the procedure, that is, get the timestamp
for the new date you want, add 11644560000 and multiply by 10,000,000. You will also need to format
the resultant number to make sure it is not outputted in scientific notation for AD to be happy with
it.
Hope this helps!
----
Manual Page -- http://www.php.net/manual/en/ref.ldap.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57855
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57855&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57855&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57855&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57855&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57855&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57855&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57855&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57855&report=yes
Search -- http://master.php.net/manage/user-notes.php