Message151622
I believe I am having a similar issue to this: http://bugs.python.org/issue7150
I am in the middle of programming a quick script and now I cannot seem to get beyond this issue; as it is printing up the expiration times from the AD user listings (many of which print 1601 year) it finally fails after the same user account, I have compared accounts and the expiration is the same as other accounts in AD: which is set to (never)
any ideas of what's going on here and how I can bypass this error?
error report:
Traceback (most recent call last):
... line 14, in <module>
print user.name + ": " + str(user.accountExpires)
File "C:\Python27\lib\site-packages\active_directory.py", line 425, in __getattr__
self._delegate_map[name] = converter (attr)
File "C:\Python27\lib\site-packages\active_directory.py", line 335, in convert_to_datetime
return ad_time_to_datetime (item)
File "C:\Python27\lib\site-packages\active_directory.py", line 319, in ad_time_to_datetime
return BASE_TIME + delta
OverflowError: date value out of range
code:
import active_directory
from datetime import datetime,timedelta
##check AD for account expirations
users = active_directory.AD_object ("LDAP://ou=administration,dc=domain,dc=com")
for user in users.search (objectCategory='Person'):
dn = user.distinguishedName
dn = dn.encode("utf-8") #for the occasional apostrophe
if "Adjuncts" in str(dn):
print user.name + ": " + str(user.accountExpires)
print "done"
example output:
CN=John Hancock: 1601-01-01 00:00:00
CN=Jane Smith: 1601-01-01 00:00:00
... |
|
Date |
User |
Action |
Args |
2012-01-19 14:14:17 | scape | set | recipients:
+ scape |
2012-01-19 14:14:17 | scape | set | messageid: <1326982457.08.0.645011585605.issue13825@psf.upfronthosting.co.za> |
2012-01-19 14:14:16 | scape | link | issue13825 messages |
2012-01-19 14:14:15 | scape | create | |
|