Saturday, May 10, 2014

Powershell: Win32_Process: List account for each process

How many times have you been asked to find out what account is being used for a
specific process or service?
I can count about a hundred.
Well, in two lines you can dazzle your boss or client with this gem: 
$process = Get-CimInstance -Class Win32_Process
$process | Invoke-CimMethod -MethodName GetOwner

No comments:

Post a Comment