Re: scripting computer list users logged on



On Tue, 5 Apr 2005 08:23:03 -0700, "derek" <derek@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>Not sure where to post this, but here it goes
>
>I have a text file with a list of computer names
>I wanted to see who is logged on to each of the computer names on the list
>
>Is there a script or tool that can help me out
>
>Thanks


Using PsLoggedOn from tip 2890 in the 'Tips & Tricks' at http://www.jsifaq.com

WhoIsOn Filename.txt

@echo off
if {%1}=={} @echo Syntax: WhoIsOn filename.txt&goto :EOF
setlocal
set filename=%1
for /f "Tokens=*" %%c in ('type %filename%') do (
for /f "Tokens=*" %%u in ('psLoggedOn -L \\%%c^|Find "/"') do (
@echo %%c %%u
)
)
endlocal



Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
.



Relevant Pages


Loading