Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
and it works so I made this conversionSet objUser = GetObject("LDAP://CN=Leigh.Smith,OU=USERS,OU=XXXX01,DC=X +XX,DC=XXXX,DC=com") Set objLastLogon = objUser.Get("lastLogonTimestamp") intLastLogonTime = objLastLogon.HighPart * (2^32) + objLastLogon.LowPa +rt intLastLogonTime = intLastLogonTime / (60 * 10000000) intLastLogonTime = intLastLogonTime / 1440 WScript.Echo intLastLogonTime Wscript.Echo "Last logon time: " & intLastLogonTime + #1/1/1601#
The problem is that the last line I do not know how to add a date to seconds, I was able to do this in PHP. Not sure about Perl.use Win32::OLE; $objUser = Win32::OLE->GetObject('LDAP://CN=Leigh.Smith,OU=USERS,OU=XX +X,DC=XX,DC=XXX,DC=com'); $objLastLogon = $objUser->Get('lastLogonTimestamp'); $intLastLogonTime = $objLastLogon->HighPart * (2 ** 32) + $objLastLogo +n->LowPart; $intLastLogonTime = $intLastLogonTime / (60 * 10000000); $intLastLogonTime = $intLastLogonTime / 1440; print 'Last logon time: ' . $intLastLogonTime + #1/1/1601#;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Goofy Date and Time Think
by BrowserUk (Patriarch) on Dec 21, 2005 at 20:00 UTC | |
by nanojack (Initiate) on Dec 21, 2005 at 20:25 UTC | |
by BrowserUk (Patriarch) on Dec 21, 2005 at 21:46 UTC | |
by nanojack (Initiate) on Dec 21, 2005 at 21:54 UTC | |
by nanojack (Initiate) on Dec 21, 2005 at 20:16 UTC | |
|
Re: Goofy Date and Time Think
by kwaping (Priest) on Dec 21, 2005 at 20:57 UTC | |
|
Re: Goofy Date and Time Think
by strat (Canon) on Dec 22, 2005 at 09:56 UTC |