Re: scripting computer list users logged on
- From: Jerold Schulman <Jerry@xxxxxxxxxx>
- Date: Tue, 05 Apr 2005 14:48:07 -0400
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
.
- References:
- scripting computer list users logged on
- From: derek
- scripting computer list users logged on
- Prev by Date: User Logoff Event ID 1524 Event ID 1201
- Next by Date: Re: Enable Ethernet Adapter
- Previous by thread: scripting computer list users logged on
- Next by thread: Enable Ethernet Adapter
- Index(es):
Relevant Pages
|
Loading