Solved

Current Logged-on Users

Posted on 2006-06-12
3
232 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
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to debug this code 7 61
how can i unlock a picture file that was loaded in a picturebox in visual c#? 4 93
Microsoft Access combo box help 2 46
Excel Automation VBA 19 69
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

770 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