1

This is a follow up question to this question:

How can I change the default credentials used to connect to Visual Studio Online (TFSPreview) when loading Visual Studio up?

The problem I got is that if the user has check the box of "Remember my credentials", I need to delete the credentials in a way like in the answers given in the question I linked.

How can I make the user enter his credentials every time he connects without the possibility of saving his credentials?

This is something I used which worked for VS2010 but it doesn't work for VS2013:

Control Panel -> Administrative Tools -> Local Security Policy -> Local Policies -> Security Options Change “Network access: Do not allow storage of passwords and credentials for network authentication” to state Enable

Answers of changing some windows settings or even using code are both welcomed.

2
  • When you start Visual Studio 2013, are you doing so under the exact same user account as 2010? In other words, do you have 2013 set to run as administrator?
    – NotMe
    Oct 30, 2014 at 15:09
  • I just double click the shortcut to the exe file.. didn't try seeing if one of them is running as an administrator and the other one isn't.. I can check it on Sunday
    – CodeMonkey
    Oct 30, 2014 at 19:19

1 Answer 1

0

You'll have to write some code to do this.

Start with looking here: http://msdn.microsoft.com/en-us/library/windows/desktop/ee207401(v=vs.85).aspx

Essentially you need to leverage the Credential Management API to remove stored credentials. You cant stop the initial storage, but you could have a program set to execute on startup that does this for you.

Beyond that I see two other potential options.

The first is to completely disable the Credential Manager by going into services and marking the service as Disabled. https://superuser.com/questions/346745/how-can-i-disable-the-windows-credential-manager

The second would be to use the correct GPO. Specifically, Network Access: Do not allow storage of credentials or .NET Passports for network authentication.

http://www.itworld.com/article/2779749/windows/how-to-disable-credential-caching-on-client-computers.html

note that doing this might have other unintended consequences.

5
  • Do you know why is the solution i wrote in the question only works for vs2010 but not for vs2013? Maybe if we can understand this, we can find a solution which involves only changing settings without code
    – CodeMonkey
    Oct 30, 2014 at 14:18
  • I tried disabling the service but it didn't work even though I was sure it would do the trick. And about the 2nd option, it's exactly the one I wrote in my question as well but like I wrote, it for some reason works only for VS2010 but not for VS2013.. do you know why?
    – CodeMonkey
    Oct 30, 2014 at 15:00
  • BTW do you happen to have a C# example of how to remove a credential?
    – CodeMonkey
    Oct 30, 2014 at 21:05
  • 1
    @YonatanNir: No. Sadly you've exhausted my knowledge at this point. Honestly I'm not entirely sure what you are trying to accomplish with this. If you don't want the credentials stored then don't click the save checkbox. If you are trying to prevent someone else from storing them, then I'd have to question why as it doesn't seem to be a sensible thing to do.
    – NotMe
    Oct 30, 2014 at 21:47
  • That's just how we work.. people got their on station but they might give other people using their station if needed and then they can log in with their credentials and save them and it can make a mess especially if the one who logged had more permission than the original owner
    – CodeMonkey
    Oct 31, 2014 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.