Re: How to find "LastLogonTime" for users



Hi Torgeir,
Thanks for the excellent reply. As you pointed, I am trying
(http://www.rlmueller.net/Last%20Logon.htm).vbs script of Richard
Mueller [MVP] and I actually have some queries. Please note that we are
still in mixed mode.

1. Can we run this .vbs script to check only for one specific domain
controller (I understand this information is not replicated, but
still). On WAN Links, it will be very tough, there should be a way!

2. How to customize to check "LastLogonTime" only for specific user to
save time & WAN Link. Can we manipulate somewhere on strFilter =
"(&(objectCategory=person)(obj­ectClass=user))" or somewhere else??

3. For some users the "LastLogonTime" is 1/1/1601. What does this mean?

Thanks again.

Good day,
Mohammed Athif Khaleel
MVP - Windows Server
I Blog on http://msmvps.com/athif/

Torgeir Bakken (MVP) wrote:
> Hi,
>
> You could e.g. take a look at this post from Richard Mueller:
> http://groups.google.co.uk/group/microsoft.public.scripting.vbscript/msg/596286cbb2f31d2e
>
> The scripts he refers to could easily be changed to only list those
> that have not logged in for more than 100 days, or obtain the logon
> time for one specific user only.
>
> Alternatively, if the domain functional level is set to Windows Server
> 2003, you can check on the LDAP property lastLogonTimestamp, it is
> replicated between the DCs.
>
> Note that this value is only updated when the user logs in if a week
> has passed since the last update (so it is usable only to see if an
> account have been active on a weekly basis).
>
>
> A "Scripting Guys" article about lastLogonTimestamp:
>
> Dandelions, VCR Clocks, and Last Logon Times: These are a Few of Our
> Least Favorite Things
> http://www.microsoft.com/technet/scriptcenter/topics/win2003/lastlogon.mspx
>
>
> From the docs for lastLogonTimestamp:
>
> http://msdn.microsoft.com/library/en-us/adschema/ad/adam_a_lastlogontimestamp.asp
>
> <quote>
> Last-Logon-Timestamp
> This is the time that the user last logged into the domain. This value
> is only updated when the user logs in if a week has passed since the
> last update. This value is replicated.
> </quote>
>
> http://www.microsoft.com/resources/documentation/WindowsServ/2003/enterprise/proddocs/en-us/dsadmin_concepts_accounts.asp
>
> <quote>
> When the domain functional level has been set to Windows Server 2003,
> a new lastLogonTimestamp attribute is used to track the last logon
> time of a user or computer account.
> </quote>
>
>
> The above is relevant for both user and computer accounts. Note the
> once a week update only part and the Windows Server 2003 domain
> functional level prerequisite.
>
>
> Raise the domain functional level; Windows Server 2003
> http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/sag_changedomlevel.asp
>
> Raising the Roof on Domain Functional Levels
> http://www.networking.earthweb.com/netos/article.php/3298531
>
>
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx

.



Relevant Pages

  • Re: Windows 2003 Last Login
    ... >> lastlogin time field only updates every 7 days. ... the domain functional level needs to have been set to Windows ... > When the domain functional level has been set to Windows Server 2003, ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.vbscript)
  • Re: Disabling old account script needed
    ... When the domain functional level has been set to Windows Server 2003, a new lastLogonTimestamp attribute is used to track the last logon time of a user or computer account. ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windows.server.active_directory)
  • Re: I want to add fields to user report
    ... When the domain functional level has been set to Windows Server 2003, ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: Windows 2003 Last Login
    ... The WinNT property LastLogin that you use is updated at each user logon ... the domain functional level needs to have been set to Windows ... When the domain functional level has been set to Windows Server 2003, ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: Printer Admin Object
    ... and ports on local and remote computers. ... Add and delete a local or remote printer. ... Instrumentation scripts in Windows Server 2003, ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)