PowerShell中顯示進程所屬用戶


 
 

首先,以管理員身份打開PowerShell。

輸入:

get-process -includeusername | format-table -autosize

顯示如下:

Handles  WS(K) VM(M)    CPU(s)   Id UserName                                                ProcessName
-------  ----- -----    ------   -- --------                                                -----------
    445  18968   290  1,836.91 2944 HOMEPC\Raymond                                          Agent
     92   2384    26      0.02 2336 NT AUTHORITY\LOCAL SERVICE                              alg
    253   7304    85      0.39 6480 HOMEPC\Raymond                                          alicnotify
    380   7916    82    549.81 1656 NT AUTHORITY\SYSTEM                                     AlipaySecSvc
    183   4228   102     19.34 3308 NT AUTHORITY\SYSTEM                                     atieclxx
    128   2288    26      0.05  896 NT AUTHORITY\SYSTEM                                     atiesrxx
    176  11296    70      0.19 6488                                                         audiodg
    720   6920   295    255.91 5268 HOMEPC\Raymond                                          baiduyun
    845  65676   383  8,915.66 2316 HOMEPC\Raymond                                          BaiduYunGuanjia
    929 155600   572  3,104.13 5628 HOMEPC\Raymond                                          Battle.net
   1322  15560   168      2.53 7592 HOMEPC\Raymond                                          BingIMEPlatform
     75   2308    24      0.11 1740 NT AUTHORITY\SYSTEM                                     BingIMEUpdateService
     95   2892    82      0.69 3952 HOMEPC\Raymond                                          CBGrabConnect_x64
    141   2660    97      0.27 5368 HOMEPC\Raymond                                          CCBCertificate
    172   2592    83      0.05 6320 HOMEPC\Raymond                                          certd_nps3000_ICBC

 

如果不想用管理員身份的話,可以用(命令中的引號內容的空格不能省略):

tasklist /V /FO CSV | ConvertFrom-Csv  | Select-Object -Property "映像名稱","會話#   ","會話名      ","用戶名   " | Format-Table -AutoSize

結果如下:

映像名稱                  會話#    會話名       用戶名
--------                  -------- ------------ ---------
System Idle Process       0        Services     NT AUTHORITY\SYSTEM
System                    0        Services     暫缺
smss.exe                  0        Services     NT AUTHORITY\SYSTEM
csrss.exe                 0        Services     NT AUTHORITY\SYSTEM
wininit.exe               0        Services     NT AUTHORITY\SYSTEM
csrss.exe                 1        Console      NT AUTHORITY\SYSTEM
winlogon.exe              1        Console      NT AUTHORITY\SYSTEM
services.exe              0        Services     NT AUTHORITY\SYSTEM
lsass.exe                 0        Services     NT AUTHORITY\SYSTEM
svchost.exe               0        Services     NT AUTHORITY\SYSTEM

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM