Hello Scripting Guys!
I wrote a dummy Task manager GUI for simple users via PowerShell. It works fine when I run with administrator privilege but it doesn't work with non administrator user.
The problematic command is:
Get-Process -IncludeUserName | Where-Object {$_.username -like $user} | select processname
Error massage:
Powershell.exe : The 'IncludeUserName' parameter requires elevated user rights. Try running the command again in a session that has been opened with elevated user rights (that is, Run as Administrator).
At C:\install\TaskManager.ps1:32 char:1
+ Powershell.exe -windowstyle hidden { #PowerShell ablak ne fusson a program mögöt ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-Process], InvalidOperationException
+ FullyQualifiedErrorId : IncludeUserNameRequiresElevation,Microsoft.PowerShell.Commands.GetProcessCommand
I would like to find a bypass solution, can anyone help?
Thanks is advance,
Zsolt