win-query-utils
use windows query.exe
to do the query and return the results
Usage
queryUser | querySession | queryProcess (options, callback)
options
- timeout : default: 5000, if the
query
command hang there for some reason, set this value to force return error and kill the process. - serverName : corresponding to the
/SERVERNAME
option ofquery.exe
Note: options can be omitted to use the default values
Example
var winQueryUtils = ;var _ = ; winQuerUtils
APIs
- queryUser returns the results of command
query user
username: 'string' sessionName: 'string' sessionId: 'string' state: 'string' idleTime: 'string' logonTime: 'string'
- querySession returns the results of command
query session
sessionName: 'string' username: 'string' sessionId: 'string' state: 'string' type: 'string' device: 'string'
- queryProcess returns the results of command
query process
username: 'string' sessionName: 'string' sessionId: 'string' processId: 'string' processName: 'string'