Use RunAs For Proxy Authentication on Windows

Sometimes you may run into a situation where:

  • You have a proxy server that requires authentication
  • You are unable to run the program under an account that has proxy access
  • The program doesn’t respond to “407” Proxy Authentication Required by prompting for the credentials , instead it just fails.

This might occur if you have a web-based installer but want to install it on a “clean install, non domain joined machine” but the only network available requires all internet access be authenticated via a proxy server.

For example if you run Windows ADK setup under an account without credentials to a configured proxy server, the setup will fail Access Denied. Using a tool like Fiddler http://fiddler2.com you will see a plethora of 407 “Proxy Authentication Required” responses.

You can use RunAs cmd with the /netonly command to keep your current user context, but use the specified credentials for network access only. Importantly RunAs with /netonly can be used to connect with domain credentials even on a machine that is only part of a workgroup. This can also be used if you are forced to use a local account, but want network authentication with domain credentials.

runas /netonly /user:<domain\username> <process to launch>

However it is important to know this command does not attempt to verify your credentials are correct. If you type them incorrectly (i.e. wrong password) the RunAs will not fail, only any attempted network access will fail. (and you might lock out your account!)

For example, even a totally made up domain/username/password combination will “work” However when the credentials are attempted to be used to access a network resource, they will fail.

image

This method can also be used for connection to network shares.

About Malcolm McCaffery

specializes in end-user computing technologies. disclaimer 1) use at your own risk. test any solution in your environment. if you do not understand the impact/consequences of what you're doing please stop, and ask advice from somebody who does. 2) views are my own at the time of posting and do not necessarily represent my current view or the view of my employer and family members/relatives. 3) over the years Microsoft/Citrix/VMWare have given me a few free shirts, pens, paper notebooks/etc. despite these gifts i will try to remain unbiased.
This entry was posted in Command Line, Fiddler, Internet Explorer and tagged . Bookmark the permalink.

2 Responses to Use RunAs For Proxy Authentication on Windows

  1. ericlaw1979 says:

    Alternatively, you could configure Fiddler to perform the authentication on your behalf by using the X-AutoAuth Session flag, containing the username/password.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s