Jump to content
  • 0
Barry.Collins

Powershell Redirector

Question

After many hours of frustration I've finally got this to work.

This will give you the full Powershell experience as if you'd used Enter-PSSession to access a server in your own LAN.

(Requires Tunnels!)

 

 

Name: Powershell

Program: %windir%\system32\WindowsPowershell\v1.0\powershell.exe

Arguments: -noexit -command "$cred = get-credential; enter-pssession localhost -port %LocalPort1% -credential $cred"

 

LocalPort: 0

LocalIP: 127.0.0.1

RemotePort: 5985

RemoteIP: %RemoteIP%

Socket Function: TCPLocalListen

 

 

If you have the correct credentials set against the location you can use the following arguments to connect without having to manually enter them each time:

-noexit -command "$secpasswd = ConvertTo-SecureString '%computerpassword%' -AsPlainText -Force; $cred = New-Object System.Management.Automation.PSCredential ('%computerdomain%\%computerusername%', $secpasswd); enter-pssession localhost -port %LocalPort1% -credential $cred"

Edited by Guest

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

This is awesome! I've been trying to get this working for a while. Unfortunately its not working for me.

 

Does remoteport need to be %remoteip% or is that a typo?

Share this post


Link to post
Share on other sites
  • 0

I was glad to find this and it works wonderfully. However, I was wondering if there is a way to connect to a session (or add the pssnapin) for Exchange management. That would be super awesome!

 

Thanks,

kurt

Share this post


Link to post
Share on other sites
  • 0

Hi,

 

This sounds really handy but I'm struggling to get it working. I'm wondering whether I need to specify any additional items on the config?

I've gone to the dashboard -> Config -> Redirected Apps, and added a new redirector and then added the Redirected Ports line. I also checked the Basic, Device and Computer boxes as that needed doing before the Powershell item would appear on the network redirectors menu.

My issue is that, if I initiate a Powershell session against a remote device, a Powershell window does indeed appear but it's against my local device rather than the remote one.

Share this post


Link to post
Share on other sites
  • 0

Tim, search here for the powershell plugin. MUCH more integrated, newer solution.

 

Sent from my SAMSUNG-SM-G930A using Tapatalk

Share this post


Link to post
Share on other sites
  • 0

The PowerShell plugin from Squidworks doesn't seem to work for me so I have been playing with this solution for a couple days now, with mixed results.

 

For servers, it appear to run just fine, Windows 8 and Windows 10 appear to be working as well. However I have tried it to remote into Windows 7 Pro machines and I have "Access denied" failures right and left for no rhyme or reason. I run "winrm quickconfig -quiet" in elevated command prompt with no errors, yet some machines just won't let me in. All those are domain joined (different domains at different clients) and each time I use a domain admin account yet no dice. Not sure where I could find/enable logs that would give me more details than "Access denied". There are tons of results on Google but they all have to do with not being able to run winrm properly in the first place.

 

Anybody has any clue on getting a handle on this?

 

Thanks,

Christian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×