Who is logged into remote workstation

G

Guest

I'm looking for a way to determine who is logged into remote computers
running Win2k and Win XP Pro. I am currently attempting this on a Win2k
machine but will be migrating to Win XP Pro sometime in the future. I am the
workgroup manager and have admin access to all the systems under my control.
I've used nbtsta -a to great affect but it's time consuming when you're
talking about 100+ machines. I'd like to see if there is a faster way or a
way to automate it and have the results print out to a file. Can anyone
provide some help?
 
J

Jerold Schulman

I'm looking for a way to determine who is logged into remote computers
running Win2k and Win XP Pro. I am currently attempting this on a Win2k
machine but will be migrating to Win XP Pro sometime in the future. I am the
workgroup manager and have admin access to all the systems under my control.
I've used nbtsta -a to great affect but it's time consuming when you're
talking about 100+ machines. I'd like to see if there is a faster way or a
way to automate it and have the results print out to a file. Can anyone
provide some help?

See tip 4712 » PsLoggedOn freeware tells you who is logged onto a computer, or it can locate a user.
in the 'Tips & Tricks' at http://www.jsifaq.com

What is the name of your workgroup? Run
net view /domain
and it should be listed.

Assuming your workgroup was name WORKGROUP, try the following batch:

@echo off
setlocal ENABLEDELAYEDEXPANSION
for /f "Tokens=1" %%c in ('net view /DOMAIN:WORKGROUP ^|FIND "\\"') do (
set usr=%%c
set usr=!usr:\=!\
for /f "Tokens=*" %%u in ('PsLoggedOn -L %%c^|FIND /I "!usr!"') do (
@echo %%c %%u
)
)
endlocal\

This should return every logged on user in the following format:
\\JSI003 07/10/2005 11:28:14 JSI003\Jerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top