• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 317
  • Last Modified:

Get the current loged in username of all machines in the network.

Hi,

I want to Get the current loged in username of all machines in the network.

Username > machine name

Regards
Sharath
0
bsharath
Asked:
bsharath
1 Solution
 
canaliCommented:
PsLoggedOn is an applet that displays both the locally logged on users and users logged on via resources for either the local computer, or a remote one. If you specify a user name instead of a computer, PsLoggedOn searches the computers in the network neighborhood and tells you if the user is currently logged on.

http://www.microsoft.com/technet/sysinternals/utilities/psloggedon.mspx
0
 
RobOwner (Aidellio)Commented:
The Microsoft Sysinternals utilities are great for a network admin like yourself.  have a look through all of them as you'll find they can help you answer most questions you have
0
 
bsharathAuthor Commented:
I want to get only the usernames on the machine names which i have in a file.

Machine name > Current logged in user
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
Farhan KaziSystems EngineerCommented:
:: ===============
:: READ THIS FIRST
:: ===============
:: * Successful run will generate "LoginReport.txt" file on C: drive root.
:: * Copy and paste following script in notepad and save it with any name having .cmd extension.
:: *** SCRIPT START ***
@Echo OFF
SETLOCAL

IF EXIST C:\LoginReport.txt DEL /F /Q C:\LoginReport.txt
FOR /F "tokens=1 eol=T skip=3" %%c IN ('Net View') Do (
      Echo Querying %%c
      Echo ---------------------- >>C:\LoginReport.txt
    Echo System Name: %%c           >>C:\LoginReport.txt
      Echo ---------------------- >>C:\LoginReport.txt
      PSLoggedOn %%c | Find "/"   >>C:\LoginReport.txt
)
ENDLOCAL
:: *** SCRIPT END ***
0
 
bsharathAuthor Commented:
Any way to scan particular machines in the file?
0
 
bsharathAuthor Commented:
I get this.

----------------------
System Name: \\DEV-CHEN-MRD100          
----------------------
     7/11/2007 8:03:32 AM    DEVELOPMENT\SharathR
     7/22/2007 10:01:21 PM    DEVELOPMENT\SASIKUMARY
     7/22/2007 10:01:59 PM    \\DEV-CHEN-MRD100\ADMINISTRATOR
----------------------

I think it even shows the files accessed.Not only the users logged on locally.Through the console or Mstsc
0
 
Farhan KaziSystems EngineerCommented:
:: ===============
:: READ THIS FIRST
:: ===============
:: * Successful run will generate "LoginReport.txt" file on C: drive root.
:: * Copy and paste following script in notepad and save it with any name having .cmd extension.
:: *** SCRIPT START ***
@Echo OFF
SETLOCAL

IF EXIST C:\LoginReport.txt DEL /F /Q C:\LoginReport.txt
FOR /F "tokens=1 eol=T skip=3" %%c IN ('Net View') Do (
    Echo Querying %%c
    Echo ------------------------------ >>C:\LoginReport.txt
    Echo System Name: %%c        >>C:\LoginReport.txt
    Echo ------------------------------ >>C:\LoginReport.txt
    PSLoggedOn %%c -l | Find "/"  >>C:\LoginReport.txt
)
ENDLOCAL
:: *** SCRIPT END ***
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now