views:

47

answers:

4

My main domain account does not have local admin privileges and I start Visual Studio using RunAs and another account that has local admin privileges.

Our Team Foundation Server (2008) is configures to recognise the main domain accounts not the local admin accounts. This means I have to log into TFS after starting VS with the admin account. Note that TFS is on our domain and it's VS that is prompting for credentials.

Is there any way I can automate the logon to TFS to use my main domain account?

A: 

Pro tip: Log into the TFS server's website with IE. Check remember password. Now it will remember it from VS :)

leppie
Thanks leppie, but this doesn't work. TFS is on our domain and it's VS that is prompting for the credentials. I've updated the question to say TFS is on the domain.
Sean Kearon
@Sean Kearon: That is weird that it actually prompts you then. My 'solution' works for TFS servers in different domains or online like Codeplex. Unfortunately, I dont have a TFS server on our 'local' domain.
leppie
Only sites which can be determined to be intranet default to supporting remembered passwords. Internet do not for security reasons. Consider going to Windows Credential Manager in windows 7 or adding the server/domain to your Intranet list via: Internet Options -> Security -> Sites -> Advanced... Add the site. You will need to do this while running under the Run As credentials, so consider logging into your machine as that user doing the above and then doing run as later.
Ryan Cromwell
A: 

Have you tried http://runas-professional.software.informer.com/

chugh97
Haven't tried this, but it seems that this just helps with the initial RunAs command. It doesn't integrate into VS and handle passing credentials to TFS - unless I've missed something.
Sean Kearon
A: 

I would suggest that either you have the local-admin-wielding account added to TFS (if it isn't a shared account, that is), or you log in as local admin, and add your main domain account to local administrators. It's either that, or you'll need to log in to TFS every time, I believe.

Also, it's not Visual Studio that is prompting you for credentials, it is Team Foundation Server. Basically, when TFS tries to make the connection to TFS, it tries to log on with your current network credentials. If that doesn't work, it will bring up the appropriate dialog(s) to prompt for user id and password.

Robaticus
Thanks Robaticus - after spending the day trying, I think that this is going to be the only way ahead, unless someone else can point the way...
Sean Kearon
Anybody want to give the reason for the down-vote?
Robaticus
Robaticus - yes, this does seem to be the way it works - TFS now works fine and doesn't prompt me again. The downside is that work items are now under my other account. But, hey, that's solvable with a bit of work! Many thanks for the answer. Also, I can't understand why you were down voted - so I voted you back up!
Sean Kearon
Glad you got it to work. Thanks!
Robaticus
A: 

Login to the machine as the administrative user.

Then either login to the TFS webserver, or (on win7) go to:

Control Panel -> User Accounts -> User Accounts -> Manage you credentials 

add the information here.

Jim T
Thanks Jim, but we have to log on using the non-admin account.
Sean Kearon
You should only need to log in once, or perhaps you can run control panel (or the user accounts part) as the admin user instead.
Jim T
Each elevated VS session seems to make a separate connection and asks for credentials. Am currently trying @Robaticus' answer to see if that works.
Sean Kearon