Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

open applications on a workstation

Posted on 2004-11-03
9
Medium Priority
?
225 Views
Last Modified: 2013-12-04
Is there a software package I can run that will tell me in real-time what applications are running on a workstation and several workstations at the same time.?   I would like to see who is running lets say kazaa.exe and what workstation and what user name... or other applications....  A list of all running exe files basically sorted by workstation...
0
Comment
Question by:earl1
  • 4
  • 2
6 Comments
 
LVL 6

Expert Comment

by:kapes
ID: 12493722
If you have all the workstation supporting WMI and you have Admin rights on all machines..

then Create a list of computer in a computers.txt file,
e.g.
----Computers.txt ----------
Comp1
Comp2
PC3
PC5
10.1.1.1
------------------------------

Also Create a ProcessList.txt file,

e.g.
------------ProcessList.txt---------
kazaa.exe
pinball.exe
chess.exe
------------------------------------

Alongwith above two text files, save the following script as "ActiveProcesses.vbs" in common folder...

'-----------Script Start ---------------

Const ForReading = 1 : Const ForWriting = 2
Dim strComputer, ComputerList , ProcessList, oReportFile
Dim oFSO : Set oFSO = CreateObject ("scripting.filesystemobject")

ComputerList = oFSO.OpenTextFile("Computers.txt",ForReading).readall
ComputerList = Split (ComputerList,VbCrLf)

ProcessList = oFSO.OpenTextFile("ProcessList.txt",ForReading).readall
ProcessList = Split (ProcessList,VbCrLf)

For Each StrComputer In ComputerList
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

For Each StrProcess In ProcessList
Set colProcesses = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name =" & "'"&StrProcess&"'" )
If colProcesses.Count = 0 Then
    Wscript.Echo StrProcess & " not running On "  & strComputer
Else
    Wscript.Echo StrProcess & " is running on " & strComputer
    Set oReportFile = oFSO.OpenTextFile (strprocess&".txt",ForWriting,True)
    oReportFile.WriteLine strComputer
End If
Next
oReportFile.Close
Next


'------------------- End of Script -----------------

Then run the script...  It will create a text file for each process with list of computers running that process.

e.g. for above example
if pinball.exe is found on PC3 and PC5

Then "pinball.exe.txt" file will be created and it will contain
------Pinball.exe.txt---------
PC3
PC4
-------------------------------



0
 
LVL 6

Expert Comment

by:kapes
ID: 12493871
oops....  :-)
I am opening the reportfile for writing rather then appending.... so
That will create only last computername entry on which process was found....

ON the First line of Script, change the Value of "Const ForWriting = 2" into "Const ForAppending = 8"
and change the following line...

 Set oReportFile = oFSO.OpenTextFile (strprocess&".txt",ForWriting,True)

into

 Set oReportFile = oFSO.OpenTextFile (strprocess&".txt",ForAppending,True)

0
 
LVL 6

Accepted Solution

by:
kapes earned 1000 total points
ID: 12494176
This is the Final One.... sorry for this many changes.....

It will give the Report in the following format ----------

FileName -  "ProcessName.csv"
-----Contents-------
ComputerName , UserName , Date on which it was found




'-------------------- Script Start --------------------------------------

Const ForReading = 1 : Const ForWriting = 2 : Const ForAppending = 8
Dim strComputer, ComputerList , ProcessList, oReportFile, CompProcessList, StrLoggedInUser
Dim oFSO : Set oFSO = CreateObject ("scripting.filesystemobject")

ComputerList = Split (oFSO.OpenTextFile("Computers.txt",ForReading).readall,VbCrLf )
ProcessList = Split (oFSO.OpenTextFile("ProcessList.txt",ForReading).readall,VbCrLf )


For Each StrComputer In ComputerList
      Set objWMIService = GetObject("winmgmts:" _
          & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
      CompProcessList = ""      
      For Each StrProcess In ProcessList
            Set colProcesses = objWMIService.ExecQuery _
                ("Select * from Win32_Process Where Name =" & "'"&StrProcess&"'" )
            If colProcesses.Count <> 0 Then
                CompProcessList = StrProcess & ";" & CompProcessList
            End If
      Next
      If CompProcessList <> "" Then  
            Set colComputer = objWMIService.ExecQuery _
          ("Select * from Win32_ComputerSystem")
      
            For Each objComputer in colComputer
                StrLoggedInUser = objComputer.UserName
            Next

            If Right (CompProcessList,1 ) = ";" Then CompProcessList = Left (CompProcessList,Len(CompProcessList)-1)
            For Each Process In split(CompProcessList,";")
                  Set oReportFile = oFSO.OpenTextFile (process&".csv",ForAppending,True)
                  oReportFile.Writeline strComputer & "," & StrLoggedInUser & "," & Date()
                  oReportFile.Close
            Next
      End If
      
Next

'------------------------------- Script Ends --------------------------------
0
Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

 
LVL 1

Assisted Solution

by:Giza
Giza earned 1000 total points
ID: 12547863
Dameware NT Utilities from www.dameware.com would do the job for you as well. Assuming you have access rights to the workstations in question it'll show you running processess, shares, installed software and much more. Inlcuding remote control software that I find alot smoother than vnc or pcanywhere.
0
 
LVL 1

Expert Comment

by:Giza
ID: 14096052
Since just two of us answered I'm all for splitting the points down the middle.
0
 
LVL 6

Expert Comment

by:kapes
ID: 14107716
I dont mind about the points,
but did the ASKER get what he wanted or not...
if he got some other solution, he shud post it here...


0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
Security measures require Windows be logged in using Standard User login (not Administrator).  Yet, sometimes an application has to be run “As Administrator” from a Standard User login.  This paper describes how to create a shortcut icon to launch a…
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

581 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