
Logon Date/Time Script Won't Run
Hey-
I need to know what is wrong with the language with script down at the
bottom. I try to put to run it as user.bat, and I get "Syntax Not Found" or
there about. I running Windows 2000 Server SP1. Any information would be
very helpful.
Thanx,
James Schreiber
----------------------------------------------------------------------------
---------------
3437 ? How do I display the previous logon date/time in a logon script?
If you run your logon script visible, you might want to display a previous
logon message to your users, similar to:
Last logon was 03/01/2001 10:16 from computer name <Computer Name>.
To implement this display function:
1. Create a LastLogon$ share on your PDC.
2. Grant the Everyone full control on the share.
3. Set the NTFS permissions on the shared folder to:
Authenticated Users - Read + Add (write).
Creator Owner - Change.
call :lastLogon <\\PDCname>
Goto end
:LastLogon
setlocal
set PDCname=%1
if exist "%PDCname%\lastlogon$\%username%.lli" type
"%PDCName%\lastlogon$\%username%.lli"
if exist "%PDCname%\lastlogon$\%username%.lli" del /q
"%PDCName%\lastlogon$\%username%.lli"
For /f "Skip=19 Tokens=*" %%i in ('Net user "%username%" /domain') do call
:llifind "%%i"
endlocal
goto end
:llifind
set line=%1
set line=%line:"=%
if not "%line:~0,10%" EQU "Last logon" goto end
:end
NOTE: The first time a user logs on after you implement the script, nothing
is displayed, but the the event is recored at
%PDCname%\lastlogon$\%username%.lli.
NOTE: See WhereIs.