Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WinRM & MainWindowTitle

Status
Not open for further replies.

peterlyttle

Technical User
Nov 6, 2006
139
GB
Hello,

Im currently trying to execute this command on a remote server -

Code:
Get-Process | Select-Object MainWindowTitle

Locally it runs fine and gives me the Window Titles, on investigation it doesnt work remotely so I looked at using WinRM to execute the command on the server. This doesnt work either.

Code:
Get-PSSession server.domain
[server.domain]Get-Process | Select-Object MainWindowTitle

Anyone have any ideas?

Cheers,
Peter
 
On both sides, have you run:
Code:
Enable-PSRemoting
You must run that from an elevated PS session.

You then need to set the allowed hosts:
Code:
cd wsman:
set-Item TrustedHosts *
restart-Service winrm

From there you should be able to execute your above commands.

I hope that helps.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Hi Mark,

I've already done that but it just returns blank values for the MainWindowTitle field.

Cheers,
Peter
 
I was having a think about this some more and I can see why it wouldnt work.

When the remote session is executed whos to say that its executed in the same user session that logged in an executing XY&Z application.

I think however if I can query the Enviromental Variables associated with a specific process this would work... the only trouble is that I've only seen this done in ProcessXP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top