Monday 24 September 2012

Returns the owner/username of the current script process -


gwmi win32_process -Filter "ProcessID = '$pid'" | Select Commandline, @{Name="Owner"; Expression = {$_.getowner().User}} 



I have no idea why I needed this last week...

No comments:

Post a Comment