[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Find specific user account on multiple machines on the network

Posted on 2005-05-13
Medium Priority
Last Modified: 2008-03-06
Is there any sort of script that will allow me to scan all machines on the network for a specific user account?
Question by:dabryantIT
LVL 10

Accepted Solution

Longbow earned 2000 total points
ID: 13999480
Set WshShell = WScript.CreateObject("WScript.Shell")
sDomain       = "IDEAL"
Set oDomain       = GetObject("WinNT://" & sDomain)
oDomain.Filter       = Array("Computer")
For Each oADobject In oDomain
      WScript.Echo oADobject.Name
      WshShell.Run "cmd /k psloggedon -d " & sDomain & " \\" & oADobject.Name & " >>c:\log.txt",1, true

Psloggedon.exe can be found in the PSTools 2.1
 at http://www.sysinternals.com
Psloggedon.exe /? for the syntax
You can also use the redirection, the | pife followed by a Find command
Psloggedon will check each PC's registry.
When a PC is closed it will takes more time before checking the Next PC.
Wscript.Echo can be removed from the script.

Expert Comment

ID: 14003258
As said above - psloggedon. Just enter:

psloggedon <username>

Go get a coffee and it'll be done when you get back. If you have a lot of machines then you may want to go for lunch! It can be pretty slow. A better option is to track the user logons using the login script. Simply add the line

@echo %USERNAME% logged onto %COMPUTERNAME% at %TIME% on %DATE% >> \\<server>\<public writeable share>\logons.txt

Every logon is now tracked in the logons.txt file.

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
I came across an unsolved Outlook issue and here is my solution.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month20 days, 2 hours left to enroll

872 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