Solved

Current Logged-on Users

Posted on 2006-06-12
3
235 Views
Last Modified: 2010-04-30
I have users, many of whom have GPOs which prevent them from logging concurrent sessions onto AD. I am looking to build a VB/VBscript tool permitting my Service Desk folks the chance to see which users are logged onto which workstations. I have to assume this has been done many times before...how would you suggest I start this project?

Thank you,
John
0
Comment
Question by:johndarby
[X]
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
3 Comments
 

Accepted Solution

by:
dgooderi earned 500 total points
ID: 16908763
I would start writing a wsh script which has the capability of retreiving the username from your own computer. Then make it handle mutiple computers either by reading a text file or reading computer objects directly from AD. Results would be saved to a CSV for later viewing.

I used this code to find the username from the local computer.

'******************************************************************
'***        Find Username                                       ***
'******************************************************************
Function findUserName(strComputer)
   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkConnection", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)
   For Each objItem In colItems
'      mid is used to remove any domain information. 10  was used for the length because standard usernames are not that long
      findUserName = Mid(objItem.UserName,7,10)
   Next
End Function

this function does loop through mutiple times but it does the job. It needs some tweeking.

A further addition would be to use the extracted username to get first name and last name from AD.

Hope this helps.

0
 
LVL 1

Author Comment

by:johndarby
ID: 16923393
Thanks Dgooderi!

I am just needing to loop it to look across all workstations (only) in AD.

Thanks,
John
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month8 days, 4 hours left to enroll

617 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