Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Users logged in to computers

Posted on 2013-12-10
6
270 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
ID: 39710515
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
ID: 39710552
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
ID: 39710763
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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Author Comment

by:jskfan
ID: 39712850
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
ID: 39728256
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
ID: 39728257
Thank you Guys...The script I posted did the work
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

790 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