User Monitoring

G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.domain (More info?)

Does anyone have a script that will reports users last
login dates\times on a domain ??
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.domain (More info?)

try usrstat.exe from nt resource kit
it works out fine for me.
>-----Original Message-----
>Does anyone have a script that will reports users last
>login dates\times on a domain ??
>.
>
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.domain (More info?)

>-----Original Message-----
>try usrstat.exe from nt resource kit
>it works out fine for me.
>>-----Original Message-----
>>Does anyone have a script that will reports users last
>>login dates\times on a domain ??
>>.
>>
>.
>Thanks - have tried that, but the output is not very easy
to manipulate in Excel etc. Was being lazy and hoped
someone may have an alternative

Graeme
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.domain (More info?)

I never got around to finishing it, but I've attached a script that uses
usrstat, then parses the output into a CSV file. I also included a
sample of the CSV and an interim file.

The CSV will contain the last logons for each user as reported by each
DC. I didn't bother to work it further. It's simple enough to open it in
a spreadsheet program and sort by user, then date.



On Wed, 18 Aug 2004 06:38:37 -0700, "Graeme Methven"
<anonymous@discussions.microsoft.com> wrote:

>
>>-----Original Message-----
>>try usrstat.exe from nt resource kit
>>it works out fine for me.
>>>-----Original Message-----
>>>Does anyone have a script that will reports users last
>>>login dates\times on a domain ??
>>>.
>>>
>>.
>>Thanks - have tried that, but the output is not very easy
>to manipulate in Excel etc. Was being lazy and hoped
>someone may have an alternative
>
>Graeme

--
Note, I seldom respond to email questions. Please keep discussions in
the news group, so everyone can benefit from them (including me <g>).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
John R Buchan ........................ jrb-tech(at)unknownegg(dot)org

begin 644 0rl-lastlogon.csv
M(D1#,2(L(B`@("`@("`@("`@($I14"`B+"(@("`@("`@("!*;VAN(%$@4'5B
<;&EC("(L(C(P,#0M,#4M,C8@,#<Z-3DZ-#DB("`@
`
end

begin 644 lastlogon.bat.txt
M0&5C:&\@;V9F#0IS970@4D532TE44$%42#U<7$UY4$-<;G0T<F5S:VET)`T*
M<V5T($E.1D]0051(/5Q<37E3<G9<;&%S=&QO9V]N#0H-"G)E;2`J*BHJ($UY
M1&]M("HJ*BH-"B`@<V5T(%1-4$911DX])4E.1D]0051()5Q->41O;2UU<V5R
M<W1A="YT>'0-"B`@<V5T($]55$911DX])4E.1D]0051()5Q->41O;2UL87-T
M;&]G;VXN8W-V#0H@(&1E;"`E3U541E%&3B4-"@T*("!E8VAO(%)U;FYI;F<@
M=7-R<W1A="!O;B!D;7)?37E$;VT-"B`@)5)%4TM)5%!!5$@E7'5S<G-T870@
M37E$;VT@/B5435!&449.)0T*#0H@(&5C:&\@4&%R<VEN9R!U<W)S=&%T(&]U
M='!U=`T*("!F;W(@+V8@(F1E;&EM<SU<+3HL('1O:V5N<STQ+#(L-"PU+#8L
M-RPX(B`E)6$@:6X@*"=T>7!E("5435!&449.)2<I(&1O(&-A;&P@.G!A<G-E
M270@(B4E82(@(B4E8B(@)25C("4E9"`E)64@)25F("4E9PT*#0IG;W1O(#IE
M;F0-"@T*.G!A<G-E270-"B`@:68@)3$N/3TN(&=O=&\@.D5/1@T*("!I9B`E
M,BX]/2X@9V]T;R`Z14]&#0H@(&EF(&YO="`E,3T](E5S97)S(&%T("(@9V]T
M;R`Z;F5X=%5S97(-"B`@<V5T($1#7TY!344])3(-"B`@<V5T($1#7TY!344]
M)41#7TY!344Z(CTE#0H@(&5C:&\@+BXN4')O8V5S<VEN9R!D871A(&9R;VT@
M)41#7TY!344E#0IG;W1O(#I%3T8-"@T*.FYE>'15<V5R#0H@('-E="!435!?
M1$%413T-"B`@:68@)3,N/3U.979E<BX@<V5T(%1-4%]$051%/2(Q.3@P+3$M
M,2`P,#HP,#HP,2(-"B`@:68@)30N/3U*86XN('-E="!435!?1$%413TB)3DM
M,#$M)34@)38Z)3<Z)3@B#0H@(&EF("4T+CT]1F5B+B!S970@5$U07T1!5$4]
M(B4Y+3`R+24U("4V.B4W.B4X(@T*("!I9B`E-"X]/4UA<BX@<V5T(%1-4%]$
M051%/2(E.2TP,RTE-2`E-CHE-SHE."(-"B`@:68@)30N/3U!<'(N('-E="!4
M35!?1$%413TB)3DM,#0M)34@)38Z)3<Z)3@B#0H@(&EF("4T+CT]36%Y+B!S
M970@5$U07T1!5$4](B4Y+3`U+24U("4V.B4W.B4X(@T*("!I9B`E-"X]/4IU
M;BX@<V5T(%1-4%]$051%/2(E.2TP-BTE-2`E-CHE-SHE."(-"B`@:68@)30N
M/3U*=6PN('-E="!435!?1$%413TB)3DM,#<M)34@)38Z)3<Z)3@B#0H@(&EF
M("4T+CT]075G+B!S970@5$U07T1!5$4](B4Y+3`X+24U("4V.B4W.B4X(@T*
M("!I9B`E-"X]/5-E<"X@<V5T(%1-4%]$051%/2(E.2TP.2TE-2`E-CHE-SHE
M."(-"B`@:68@)30N/3U/8W0N('-E="!435!?1$%413TB)3DM,3`M)34@)38Z
M)3<Z)3@B#0H@(&EF("4T+CT]3F]V+B!S970@5$U07T1!5$4](B4Y+3$Q+24U
M("4V.B4W.B4X(@T*("!I9B`E-"X]/41E8RX@<V5T(%1-4%]$051%/2(E.2TQ
M,BTE-2`E-CHE-SHE."(-"@T*("!E8VAO("(E1$-?3D%-124B+"4Q+"4R+"54
K35!?1$%4124@/CXE3U541E%&3B4-"F=O=&\@.D5/1@T*#0H-"CIE;F0-"B54
`
end

begin 644 orl-userstat.txt
M57-E<G,@870@7%Q$0S$-"B`@("`@("`@("`@($I14"`M("`@("`@("`@2F]H
L;B!1(%!U8FQI8R`M(&QO9V]N.B!7960@36%Y(#(V(#`W.C4Y.C0Y(#(P,#1H
`
end
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.domain (More info?)

Thanks for that John - where are the attached files ?
Can't seem to find them

Graeme
>-----Original Message-----
>I never got around to finishing it, but I've attached a
script that uses
>usrstat, then parses the output into a CSV file. I also
included a
>sample of the CSV and an interim file.
>
>The CSV will contain the last logons for each user as
reported by each
>DC. I didn't bother to work it further. It's simple
enough to open it in
>a spreadsheet program and sort by user, then date.
>
>
>
>On Wed, 18 Aug 2004 06:38:37 -0700, "Graeme Methven"
><anonymous@discussions.microsoft.com> wrote:
>
>>
>>>-----Original Message-----
>>>try usrstat.exe from nt resource kit
>>>it works out fine for me.
>>>>-----Original Message-----
>>>>Does anyone have a script that will reports users last
>>>>login dates\times on a domain ??
>>>>.
>>>>
>>>.
>>>Thanks - have tried that, but the output is not very
easy
>>to manipulate in Excel etc. Was being lazy and hoped
>>someone may have an alternative
>>
>>Graeme
>
>--
>Note, I seldom respond to email questions. Please keep
discussions in
>the news group, so everyone can benefit from them
(including me <g>).
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~
>John R Buchan ........................ jrb-tech(at)
unknownegg(dot)org
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.domain (More info?)

They were definitely attached to my last post. I can't tell you how to
access attachments with your news reader, though. Here's the body of
the attachments. Keep in mind that some of these lines will end up
wrapped by one or both of our news readers. You may need to recombine
them.

==================
lastlogon.bat.txt
==================
@echo off
set RESKITPATH=\\MyPC\nt4reskit$
set INFOPATH=\\MySrv\lastlogon

rem **** MyDom ****
set TMPFQFN=%INFOPATH%\MyDom-userstat.txt
set OUTFQFN=%INFOPATH%\MyDom-lastlogon.csv
del %OUTFQFN%

echo Running usrstat on dmr_MyDom
%RESKITPATH%\usrstat MyDom >%TMPFQFN%

echo Parsing usrstat output
for /f "delims=\-:, tokens=1,2,4,5,6,7,8" %%a in ('type %TMPFQFN%') do
call :parseIt "%%a" "%%b" %%c %%d %%e %%f %%g

goto :end

:parseIt
if %1.==. goto :EOF
if %2.==. goto :EOF
if not %1=="Users at " goto :nextUser
set DC_NAME=%2
set DC_NAME=%DC_NAME:"=%
echo ...Processing data from %DC_NAME%
goto :EOF

:nextUser
set TMP_DATE=
if %3.==Never. set TMP_DATE="1980-1-1 00:00:01"
if %4.==Jan. set TMP_DATE="%9-01-%5 %6:%7:%8"
if %4.==Feb. set TMP_DATE="%9-02-%5 %6:%7:%8"
if %4.==Mar. set TMP_DATE="%9-03-%5 %6:%7:%8"
if %4.==Apr. set TMP_DATE="%9-04-%5 %6:%7:%8"
if %4.==May. set TMP_DATE="%9-05-%5 %6:%7:%8"
if %4.==Jun. set TMP_DATE="%9-06-%5 %6:%7:%8"
if %4.==Jul. set TMP_DATE="%9-07-%5 %6:%7:%8"
if %4.==Aug. set TMP_DATE="%9-08-%5 %6:%7:%8"
if %4.==Sep. set TMP_DATE="%9-09-%5 %6:%7:%8"
if %4.==Oct. set TMP_DATE="%9-10-%5 %6:%7:%8"
if %4.==Nov. set TMP_DATE="%9-11-%5 %6:%7:%8"
if %4.==Dec. set TMP_DATE="%9-12-%5 %6:%7:%8"

echo "%DC_NAME%",%1,%2,%TMP_DATE% >>%OUTFQFN%
goto :EOF


:end

==================
orl-userstat.txt
==================
Users at \\DC1
JQP - John Q Public - logon: Wed May 26 07:59:49
2004


==================
0rl-lastlogon.csv
==================
"DC1"," JQP "," John Q Public ","2004-05-26 07:59:49"


On Thu, 19 Aug 2004 01:08:32 -0700, "graeme methven"
<graeme.methven@scottishwidows.co.uk> wrote:

>Thanks for that John - where are the attached files ?
>Can't seem to find them
>
>>-----Original Message-----
>>I never got around to finishing it, but I've attached a
>script that uses
>>usrstat, then parses the output into a CSV file. I also
>included a
>>sample of the CSV and an interim file.
>>
>>The CSV will contain the last logons for each user as
>reported by each
>>DC. I didn't bother to work it further. It's simple
>enough to open it in
>>a spreadsheet program and sort by user, then date.
>>
>>On Wed, 18 Aug 2004 06:38:37 -0700, "Graeme Methven"
>><anonymous@discussions.microsoft.com> wrote:
>>>
>>>>-----Original Message-----
>>>>try usrstat.exe from nt resource kit
>>>>it works out fine for me.
>>>>>-----Original Message-----
>>>>>Does anyone have a script that will reports users last
>>>>>login dates\times on a domain ??
>>>>.
>>>>Thanks - have tried that, but the output is not very
>easy
>>>to manipulate in Excel etc. Was being lazy and hoped
>>>someone may have an alternative
--
Note, I seldom respond to email questions. Please keep discussions in
the news group, so everyone can benefit from them (including me <g>).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
John R Buchan ........................ jrb-tech(at)unknownegg(dot)org