Re: Log file!
- From: "Richard Mueller [MVP]" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 12 Jun 2005 10:42:30 -0500
Hi,
Here is an example VBScript program to retrieve the lastLogon values for all
users in a domain:
http://www.rlmueller.net/Last%20Logon.htm
As Simon mentioned, the lastLogoff attribute is never used. If you need user
logon and logoff info, you can assign Logon and Logoff scripts using Group
Policy. These scripts can log user name, computer name, and date/times
during each logon and logoff. The clients must be Wk2 or above for logoff
scripts to run. An example logon script that logs info is:
http://www.rlmueller.net/Logon5.htm
This script appends a line to a log file in a shared location. The log file
can be imported into a spread*** for analysis. A logoff script would be
similar. I used a similar logon script for years to document activity.
You can also use StartUp and Shutdown scripts to log computer activity. Just
remember that there is no user when these scripts run and they run with
permissions of the computer account.
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--
"Simon Geary" <simon_geary@xxxxxxxxxxx> wrote in message
news:OpiuA80bFHA.3464@xxxxxxxxxxxxxxxxxxxxxxx
> There is a lastLogoff user attribute you could use but it does not get
used.
> You can check for the last logon using a script though. If you are using
> Windows 2000, you must query every DC in the domain for a users lastLogon
> attribute using something like ADSI. For Windows 2003 it's much easier,
you
> can query just one DC in the domain for the lastLogonTimestamp attribute
> using the same method. The lastLogonTimestamp only gets updated every
> fortnight by default so if a user logs on multiple times in a two week
> period the attribute will not capture that. This two week period can be
> changed but will increase your replication traffic.
>
> For the actual ADSI syntax used to perform this, you might be better
asking
> in the ADSI newsgroup. You can however get the same information using any
AD
> query tool like ldifde, ldp etc. Auditing and the security event logs
could
> also be used.
>
> "c-mos" <eng_shaima1183@xxxxxxxxx> wrote in message
> news:1118572354.171899.114290@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > Hello....
> >
> > I need to know that does the log file record the user logon logoff time
> > with the user name in the log file. If it does how can I read from it
> > by using a script.
> >
> > Thanks in advance....
> >
>
>
.
- Follow-Ups:
- Re: Log file!
- From: c-mos
- Re: Log file!
- References:
- Log file!
- From: c-mos
- Re: Log file!
- From: Simon Geary
- Log file!
- Prev by Date: Re: SID security folder permissions for deleted AD user
- Next by Date: Assigning rights to a share
- Previous by thread: Re: Log file!
- Next by thread: Re: Log file!
- Index(es):