Re: garbage computer accounts
From: Richard Mueller [MVP] (rlmueller-NOSPAM_at_ameritech.NOSPAM.net)
Date: 03/31/04
- Next message: Randy Birch: "Re: Clear Recent Apps - API?"
- Previous message: Joe Earnest: "Re: FileSystemObject OpenTextFile method to prepend?"
- In reply to: Dr John Stockton: "Re: garbage computer accounts"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 30 Mar 2004 18:32:47 -0600
See comments below:
"Dr John Stockton" <spam@merlyn.demon.co.uk> wrote in message
news:VkV5F3DUYdaAFw6e@merlyn.demon.co.uk...
> JRS: In article <#fQqPqnFEHA.2404@TK2MSFTNGP11.phx.gbl>, seen in
> news:microsoft.public.scripting.wsh, Robert Cohen <dont@want.spam.com>
> posted at Tue, 30 Mar 2004 12:15:10 :
> > The LastLogon attribute is
> >' a 64-bit number representing the number of 100 nanosecond intervals
> >' since 12:00 am January 1, 1601. This value is converted to a date. The
> >' last logon date is in UTC (Coordinated Univeral Time). It must be
> >' adjusted by the Time Zone bias in the machine registry to convert to
> >' local time.
>
> For international use, 0000h or 00:00:00 is better than 12:00 am.
I agree, but usually it displays as 12:00 am on my computer.
>
> It's not actually UTC, AFAICS, since there is presumably no mechanism
> for honouring Leap Seconds. The time is now 32 seconds later than that
> algorithm thinks it is; or, rather, the count is 32E7 units less than it
> is claimed to be.
In a way you are correct, except that if the server is synchronized to a
time service, I believe it will stay in step. Each individual time value
should be correct, it's just that time intervals will be off a few seconds.
Makes you wonder why time values are saved in increments of 0.0000001
seconds.
>
> One needs to use the Time Zone bias allowing for the state of Summer
> Time (DST) at the time; Windows can only AIUI give what the local time
> would have been if the current zone and rules apply at that time and
> place.
You might be the first to notice that I use ActiveTimeBias rather than Bias
in the registry. Bias is the number of minutes west or east of the prime
meridian, but ActiveTimeBias accounts for daylight savings. Using
ActiveTimeBias converts the time to local time. However, as you noticed,
this conversion assumes that daylight savings never changes. If the date is
in the past, it could be off an hour, unless additional calculations are
done to figure out whether or not daylight savings applies to the date/time
in question. I think you are confirming this. I've never bothered coding
this, since I figure I'm only concerned about hours if the date/time is very
recent.
This also means that if you are looking at time values for users/computers
in another time zone, my program has converted to your time zone. All of the
values are in your local time, even if they apply to objects on the other
side of the world.
It may seem trivial to worry about a few hours. For finding inactive
accounts, this is true. However, it makes a big difference if you are
looking at lockoutTime (which is also Integer8) and trying to decide if the
account is still locked out and lockoutDuration is only 30 minutes.
The only time I use the Bias value in the registry is when I convert the
logonHours attribute to an array of hours the user is allowed to logon. I
puzzled over all this for some time a few years ago, so I hope I got it
right. Once again, the actual logonHours values are stored in AD in UTC, but
I believe the system adjusts this attribute for daylight savings, since we
never need to. I believe I concluded that AD must shift all logonHours
values by an hour when daylight savings changes. I never found documentation
of this, but there is no other explanation.
>
> If my diary and the BBC are right, India has recently shifted its "time
> zone" by half an hour; Delhi is now in quadrature with Greenwich.
>
> --
> © John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00
MIME. ©
> Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links,
acronyms
> PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see
00index.htm
> Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm
etc.
-- Richard Microsoft MVP Scripting and ADSI HilltopLab web site - http://www.rlmueller.net --
- Next message: Randy Birch: "Re: Clear Recent Apps - API?"
- Previous message: Joe Earnest: "Re: FileSystemObject OpenTextFile method to prepend?"
- In reply to: Dr John Stockton: "Re: garbage computer accounts"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|