[rt-users] Importing Active Directory users through Cron

fleon fleon at seguroscatatumbo.com
Thu Oct 9 16:43:04 EDT 2014


Hello everyone, i installed the LDAPImport extension and it works fine,
however i only want to import users that have logged in at least once not
farther than 3 months ago.

So i am using the lastLogonTimestamp inside $LDAPFilter, the problem is that
i don't know how to specify its value, i went to a page that offers a
calculator and started modifying the example so i had a date similar to what
i wanted, but i want to put a script in cron therefore the value in the
config can't be static.

For the record, the value stored in that attribute represents the date and
time of the account logon, expressed in 100-nanosecond steps since 12:00 AM,
January 1, 1601.

Basically i need a script that subtracts 90 days from today's date and
converts it to that format and can be referenced from RT_Siteconfig.pm 

Some guru posted this in perlmonks:

print POSIX::strftime( "%Y-%m-%d",
localtime(($lastLoginTime/10000000)-11644473600) );

But that snippet i think it's for the opposite conversion, from the windows
format to a human readable one.



--
View this message in context: http://requesttracker.8502.n7.nabble.com/Importing-Active-Directory-users-through-Cron-tp58790.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.



More information about the rt-users mailing list