users() fix when multiple explorer.exe (windows)

This commit is contained in:
Sebastian Hildebrandt 2022-12-08 16:51:40 +01:00
parent 7bf36a6d64
commit a669a71045
4 changed files with 12 additions and 6 deletions

View File

@ -82,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.16.3 | 2022-12-08 | `users()` fix when multiple explorer.exe (windows) |
| 5.16.2 | 2022-12-08 | `dockerContainerStats()` improved calculation cpuPercent |
| 5.16.1 | 2022-12-04 | code cleanup, moved from lgtm to GitHub Code Scan |
| 5.16.0 | 2022-12-01 | `fsSize()` added rw (win, linux, mac OS, BSD) |

View File

@ -58,9 +58,14 @@
</thead>
<tbody>
<tr>
<th scope="row">5.16.2</th>
<th scope="row">5.16.3</th>
<td>2022-12-04</td>
<td>code cleanup, moved from lgtm to GitHub Code Scan</td>
<td><span class="code">users()</span> fix when multiple exporer.exe opened (windows)</td>
</tr>
<tr>
<th scope="row">5.16.2</th>
<td>2022-12-08</td>
<td><span class="code">dockerContainerStats()</span> improved calculation cpuPercent</td>
</tr>
<tr>
<th scope="row">5.16.1</th>
@ -2884,4 +2889,4 @@
</body>
</html>
</html>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.16.2</span></div>
<div class="version">New Version: <span id="version">5.16.3</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div>
<div class="down">
@ -401,4 +401,4 @@
</script>
</body>
</html>
</html>

View File

@ -209,7 +209,7 @@ function users(callback) {
try {
let cmd = 'Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl' + '; echo \'#-#-#-#\';';
cmd += 'Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ' + '; echo \'#-#-#-#\';';
cmd += '$process = (Get-CimInstance Win32_Process -Filter "name = \'explorer.exe\'"); Invoke-CimMethod -InputObject $process -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo \'#-#-#-#\';';
cmd += '$process = (Get-CimInstance Win32_Process -Filter "name = \'explorer.exe\'"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo \'#-#-#-#\';';
cmd += 'query user';
util.powerShell(cmd).then((data) => {
if (data) {