processes() revert added user (windows)
This commit is contained in:
+2
-6
@@ -935,10 +935,7 @@ function processes(callback) {
|
||||
util
|
||||
.powerShell(
|
||||
`Get-CimInstance Win32_Process | select-Object ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage,
|
||||
@{n="CreationDate";e={$_.CreationDate.ToString("yyyy-MM-dd HH:mm:ss")}},
|
||||
@{n="User";e={$OwnerInfo = Invoke-CimMethod -InputObject $_ -MethodName GetOwner
|
||||
if($OwnerInfo.ReturnValue -eq 0) {"$($OwnerInfo.Domain)\\$($OwnerInfo.User)"} else {""}
|
||||
}} | ConvertTo-Json -compress`
|
||||
@{n="CreationDate";e={$_.CreationDate.ToString("yyyy-MM-dd HH:mm:ss")}} | ConvertTo-Json -compress`
|
||||
)
|
||||
.then((stdout, error) => {
|
||||
if (!error) {
|
||||
@@ -963,7 +960,6 @@ function processes(callback) {
|
||||
const utime = element.UserModeTime;
|
||||
const stime = element.KernelModeTime;
|
||||
const memw = element.WorkingSetSize;
|
||||
const user = element.User;
|
||||
allcpuu = allcpuu + utime;
|
||||
allcpus = allcpus + stime;
|
||||
result.all++;
|
||||
@@ -1000,7 +996,7 @@ function processes(callback) {
|
||||
started: element.CreationDate,
|
||||
state: statusValue ? _winStatusValues[statusValue] : _winStatusValues[0],
|
||||
tty: '',
|
||||
user,
|
||||
user: '',
|
||||
command: commandLine || name,
|
||||
path: commandPath,
|
||||
params: ''
|
||||
|
||||
Reference in New Issue
Block a user