This should always work:
(Get-WmiObject Win32_Process -filter "Name = 'powershell.exe'").GetOwner().User
Search found 2 matches
- Sun Nov 15, 2020 1:27 pm
- Jump to forum
- Jump to topic
- Sun Nov 15, 2020 5:57 pm
- Jump to forum
- Jump to topic
Re: get-process returning one user when packaged
I suspect that Get-Process should also work as it is built on top of the WMI class but the security restrictions on the Net Framework classes for the CmdLets may be rest6rticting this. When some CmdLet fails then direct access via WMI may help.