Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Watch exe on server

Status
Not open for further replies.

EZEason

Programmer
Dec 11, 2000
213
US
First, I'm a VB programmer not server admin. I do not have that much, if any, knowledge about Servers. I have been asked to develop something to watch an exe app on a server.

We have a program that is a 1mb exe that we need to know who uses the app, and who is actively using the app. The reason is we want to make sure we are in compliance with the licence for the software. The licence lets us run it from a server as long as we have a way to watch who is using the file and active users do not exceed the number of licence we have.

I need to write something to watch the app. So my questions:
Can Windows 2003 tell me who executes an app.exe? How?
Can it tell me who is activily using an app.exe? How?


What doesn't kill you makes you stronger.
 
The following will show you all the available info for a particular process via WMI.

Code:
Set objProcessSet = GetObject("winmgmts:root/cimv2").ExecQuery("SELECT * FROM Win32_Process WHERE Name ='notepad.exe'")

For Each objProcess in objProcessSet
  wscript.Echo objProcess.Caption
  wscript.Echo objProcess.CommandLine
  wscript.Echo objProcess.CreationClassName
  wscript.Echo objProcess.CreationDate
  wscript.Echo objProcess.CSCreationClassName
  wscript.Echo objProcess.CSName
  wscript.Echo objProcess.Description
  wscript.Echo objProcess.ExecutablePath
  wscript.Echo objProcess.ExecutionState
  wscript.Echo objProcess.Handle
  wscript.Echo objProcess.HandleCount
  wscript.Echo objProcess.InstallDate
  wscript.Echo objProcess.KernelModeTime
  wscript.Echo objProcess.MaximumWorkingSetSize
  wscript.Echo objProcess.MinimumWorkingSetSize
  wscript.Echo objProcess.Name
  wscript.Echo objProcess.OSCreationClassName
  wscript.Echo objProcess.OSName
  wscript.Echo objProcess.OtherOperationCount
  wscript.Echo objProcess.OtherTransferCount
  wscript.Echo objProcess.PageFaults
  wscript.Echo objProcess.PageFileUsage
  wscript.Echo objProcess.ParentProcessId
  wscript.Echo objProcess.PeakPageFileUsage
  wscript.Echo objProcess.PeakVirtualSize
  wscript.Echo objProcess.PeakWorkingSetSize
  wscript.Echo objProcess.Priority
  wscript.Echo objProcess.PrivatePageCount
  wscript.Echo objProcess.ProcessId
  wscript.Echo objProcess.QuotaNonPagedPoolUsage
  wscript.Echo objProcess.QuotaPagedPoolUsage
  wscript.Echo objProcess.QuotaPeakNonPagedPoolUsage
  wscript.Echo objProcess.QuotaPeakPagedPoolUsage
  wscript.Echo objProcess.ReadOperationCount
  wscript.Echo objProcess.ReadTransferCount
  wscript.Echo objProcess.SessionId
  wscript.Echo objProcess.Status
  wscript.Echo objProcess.TerminationDate
  wscript.Echo objProcess.ThreadCount
  wscript.Echo objProcess.UserModeTime
  wscript.Echo objProcess.VirtualSize
  wscript.Echo objProcess.WindowsVersion
  wscript.Echo objProcess.WorkingSetSize
  wscript.Echo objProcess.WriteOperationCount
  wscript.Echo objProcess.WriteTransferCount
Next

This should help you to identify how many times a process is running.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top