Link to home
Start Free TrialLog in
Avatar of Sam Jacobs
Sam JacobsFlag for United States of America

asked on

Get-Process MainWindowTitle not displayed for other users

Although I'm running an elevated PowerShell session, when I attempt to get the window titles with the PowerShell command below, they are only displayed for my own processes, and not for all users. Remaining fields are displayed for all users.  Any way to get them? Thanks.
Get-Process | Where sessionid -ne 0 | sort sessionid, name | 
	Format-Table name, sessionID, mainwindowtitle -autosize

Open in new window

Avatar of J0rtIT
J0rtIT
Flag of Venezuela, Bolivarian Republic of image

$owners = @{}
gwmi win32_process |% {$owners[$_.handle] = $_.getowner().user}
get-process | select processname,Id,@{l="Owner";e={$owners[$_.id.tostring()]}}

Open in new window

Avatar of Sam Jacobs

ASKER

@Jose,

Thanks for your response. I can get owner information by adding -IncludeUserName in the command:
Get-Process -IncludeUserName | Where sessionid -ne 0 | sort sessionid, name | 
	Format-Table userName, name, sessionID, mainwindowtitle -autosize

Open in new window

What I am looking for is the window title ... all three of us are running the same process, but the window title only shows up for mine:
User generated image
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.