Hi,
I'm trying to list all/some process and need to include the username since the script has to run in a terminal server environment. It works using WMI (Get-WmiObjectWin32_Processand GetOwner()) but get-process provides some more attributes I need to export to a logfile.
Accoring to MSDN there is a property called UserName in the StartInfo object, but the value is always empty, when executing this script:
What's wrong? I am fairly new to PS, so is this the correct way of reading that property?
Thanks, regards
I'm trying to list all/some process and need to include the username since the script has to run in a terminal server environment. It works using WMI (Get-WmiObjectWin32_Processand GetOwner()) but get-process provides some more attributes I need to export to a logfile.
Accoring to MSDN there is a property called UserName in the StartInfo object, but the value is always empty, when executing this script:
get-process
outlook | select-object id, path, @{Name="UserName";Expression = {$_.StartInfo.UserName}}What's wrong? I am fairly new to PS, so is this the correct way of reading that property?
Thanks, regards