Reputation: 71
My goal is to display the (default) browser and open a specific URL on a remote session.
1 Create PSSession on a remote computer => OK
$computerName = "yannTPI-1"
$credential = get-credential
$session = new-PSSession -computerName $computerName -credential $credential
2 Run a script => OK
invoke-command -session $session -filePath $file
3 On that script... Open browser (many way...)
[System.Diagnostics.Process]::Start("http://stackoverflow.com")
start http://stackoverflow.com
And it works, under processes I can see a process corresponding to my browser. On my remote computer I'm connected with another account that the one I use to connect to it with PSSession. So it does not display as it is not the same User Name.
How can I force the display of the browser to another user ?
Sorry english is not my mother tongue, hope I'm clear enaugh.
Upvotes: 1
Views: 6548
Reputation: 1
psexec.exe \machinename -u DOMAIN\username -i -d "c:\program files\internet explorer\iexplorer.exe" http://www.webpage.com
This will show up in the current shell of the user that is logged in.
Upvotes: 0
Reputation: 71
I tried that which quiet I'm want to do:
psexec -d "c:\program files\internet explorer\iexplore.exe"
IE Starts but the window is all black - I need the syntax to add -i [UserName/Pwd]
I also found that: Unfortunately, when you use a specific user account, PsExec passes credentials in the clear to the remote workstation, thus exposing the credentials to anyone who happens to be «listening in». Source: PsExec Security -i
I also tried on a WM and there was a big graphical problem. (Win7)
Anyway even if I'm able to open a browser correctly, is there a way to open a specific URL ? If not I won't try further.
Source: Windows Systernals PsExec
Upvotes: 0
Reputation: 25810
You cannot. Remote interactive sessions isn't possible in PowerShell remoting and WMI remoting. You should use PSExec if this is something you need to do!
Upvotes: 0