Re: garbage computer accounts

From: Richard Mueller [MVP] (rlmueller-NOSPAM_at_ameritech.NOSPAM.net)
Date: 03/31/04


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
--


Relevant Pages

  • Re: WMI LastBootUpTime wrong value
    ... To convert to local time you need to adjust using ... the time zone bias stored in the local registry. ... ' Obtain local Time Zone bias from machine registry. ...
    (microsoft.public.scripting.vbscript)
  • Re: OpenMPE redux, executive view.
    ... and have everyone see everything in their local time. ... [time zone variable set for time zone where the system is located] ... Current value of Time Zonevariable: PST8PDT ... Notice the CTIME function returns the Pacific time according to the ...
    (comp.sys.hp.mpe)
  • Re: What time is it? Issues with Local time, system time, DST
    ... works with a server that could be in a different time zone, ... is expecting to be local time. ... not the coordination of two (RTC, ... implemented years ago and we had trouble getting registry persistence ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Time Zone and DateTime voes.
    ... My problem is that for most of the cases I'm storing only the dates so I ... dont really want them to converted to local time. ... time of a time zone behind the server all the dates are off by a day. ... mistakes made in converting to the local time zone aren't as critical ...
    (microsoft.public.dotnet.general)
  • Re: Time Synchronization to Current vs Local time
    ... I found it strange then, but they decided it was out of support and was not to be done. ... Depending on the time zone you occupy, daylight savings can have strange effects. ... Then the PDC current time differed by one hour on the PDC. ... was moved forward by two hours and the local time was moved forward by one ...
    (microsoft.public.backoffice.smallbiz2000)