Solved

Users logged in to computers

Posted on 2013-12-10
6
259 Views
Last Modified: 2013-12-18
I need to query a list of computers and retrieve users that have logged in to each computer.
for instance:
computerA =User1 logged in
ComputerB=User20 logged in

it will be nice if the script can give me for instance:
computerA= user1 ,user7,user3 have logged into at separate date and time..

Thanks
0
Comment
Question by:jskfan
6 Comments
 
LVL 3

Assisted Solution

by:JoeIronsmith
JoeIronsmith earned 167 total points
Comment Utility
Hi,

You can add this into your user's logon script:

@echo off
echo %date% %time% Logon %UserName% %ComputerName% >> \\MyServer\MyShare\LogTimes.txt

Then you can open it via excel (open a new file / Data / From text) and filter and sort it based on what information you need, e.g. username, computer name, etc.

Cheers,
Joe
0
 
LVL 12

Assisted Solution

by:SreRaj
SreRaj earned 166 total points
Comment Utility
Hi,

You could try the following PowerShell script from Technet Script Gallery.

http://gallery.technet.microsoft.com/scriptcenter/d46b1f3b-36a4-4a56-951b-e37815a2df0c
0
 
LVL 39

Accepted Solution

by:
Krzysztof Pytko earned 167 total points
Comment Utility
Try to do that with free SysInternals tool called PsLoggedOn
http://technet.microsoft.com/en-us/sysinternals/bb897545.aspx

This is really easy in use tool which allows for scripting

Regards,
Krzysztof
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:jskfan
Comment Utility
PsLoggedOn tool can be used to find current logged on user to which computer.

I need the last user logged on
0
 

Author Comment

by:jskfan
Comment Utility
this is right link:

http://www.intelliadmin.com/index.php/2012/06/find-out-who-logged-on-to-a-computer/


Set objWMIService = GetObject("winmgmts:\\Remotecomputername\root\cimv2")
 Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkLoginProfile")

For Each objItem in colItems
   
   Wscript.Echo objItem.Name
   
 Next
0
 

Author Closing Comment

by:jskfan
Comment Utility
Thank you Guys...The script I posted did the work
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction You may have a need to setup a group of users to allow local administrative access on workstations.  In a domain environment this can easily be achieved with Restricted Groups and Group Policies. This article will demonstrate how to…
This article will show, step by step, how to integrate R code into a R Sweave document
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
The viewer will learn how to dynamically set the form action using jQuery.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now