Mr Rick Liptin
First as to the above function, this is working on 2003 servers. When executed by user having administrative privileges, this function lists all users using the exe. Here is the improved version.
- Code: Select all Expand view RUN
FUNCTION GetExeUsers( cExe )
local oWmi, oList, oProc
local cUser, cDomain
local aList := {}
oWmi := WmiService()
oList := oWmi:ExecQuery( "select * from Win32_Process where Name = '" + cExe + "'" )
for each oProc in oList
if ( oProc:GetOwner( @cUser, @cDomain ) ) == 0
cUser = cDomain + "\" + cUser
if AScan( aList, cUser ) == 0
AAdd( aList, cUser )
endif
endif
next
return aList
If we ourselves ( with administrative privileges) login to the server , there are many easier ways.
1) This is the simple thing I do. Open TaskManager, check "Show Processes from All Users" check box, sort the list on Image name in Processes tab and look for the executable name. We can see names of all users executing that program.
2) Run Adminstrative Toops -> Computer Management. Go to Shared Folders -> Open Files. You see all open executables/dlls and users who are using them.
I am not sure if I answered you what you are looking for.