Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Get Processes by Username without WMI

$
0
0

How about this for a solution that doesn't involve WMI.

  

#This will retrieve all processes by userid

$UserName="lsqa2setup"

$Processes=get-process|selectprocessname,Id,@{l="Owner";e={$owners[$_.id.tostring()]}}|Where-Object{$_.owner-eq$UserName}

#then filter the value you need

Foreach($Processin$Processes) { Write-host$Process.ProcessName }


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>