Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Windows account that is used for running services (ie. it's not intended that any person should log in as that account). Turns out one of the services needs to access a remote network share that's on a machine in a different Windows domain, and so needs to supply remote credentials to get to that share.

Now if it was me needing to access the remote share, I would simply open Credential Manager, and save the required credentials. But it's not me, and my understanding of credential manager is it only saves credentials to be used by the logged in user.

I can of course solve this problem. I temporarily elevate the privileges of the service account to allow interactive logins, then I login as that user and use credential manager to store the correct remote credentials. Then I remove the interactive login privileges. But that feels very hacky and not the kind of thing I ought to be doing.

So my question is: Is there another way to save remote credentials for an account other than the one you're logged in as? Any better way to solve my problem.

share|improve this question
Turns out Credentials Manager is irrelevant anyway, as it's entirely up to the app whether it uses it or not - and in my case it seems the service I'm running doesn't. Lee's answer that I've accepted is great because it sidesteps credentials manager altogether. – PhantomDrummer Jan 18 '13 at 16:12
up vote 2 down vote accepted

If you can access the remote computer, you could add your service account to the local Users group and match the username/password to what you would use. Don't forget to give it administrative privileges.

Then goto the remote login tab in the system menu, and add that user as someone who is allowed to remotely login. This is what I do when I need to hit certain machines that are on our network, but not part of the domain for whatever reason.

share|improve this answer
That's exactly what I wanted. I hadn't realised that if you had the same login and password, Windows would accept the credentials even if the login was coming from a different machine (and so had a different SID). Thanks Lee! – PhantomDrummer Jan 18 '13 at 16:10

Although it turned out to be irrelevant to your situation, for the benefit of future searchers, the answer to the actual question "Manage another user's credentials for network access" is:

runas /user:serviceaccountname "%windir%\system32\cmdkey.exe / /user:username /pass:password"

This will create a credential in serviceaccountname's credential vault for using username/password.

/user also supports domain\username and username@domain styles.

share|improve this answer
Very useful to know, thanks – PhantomDrummer Feb 8 '13 at 9:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .