8

My Windows 7 laptop is not joined to my company's Active Directory domain. However, I connect to a number of resources on the domain, including intranet sites, file shares, and TFS. Every three months, my company makes me change my password.

I've discovered that Windows 7 has a Credential Manager where I can go in and edit stored passwords. However, by the time I change my password I have at least a dozen different credentials to edit. Note that each credential has the same "domain\user" format user name.

Is there a way to change the password for every credential with the same user name?

I think the problem is more acute with file shares and TFS, where I seem to just get denied access. With intranet sites I at least get prompted by Internet Explorer to change my password (albeit repeatedly for each one I access).

  • 2
    Could you just add a domain credential for *.companydomain.tld? I'm sure Windows supports this. – grawity Jan 20 '12 at 15:16
  • @grawity yes - that works! If you put this as answer I'll give you credit. Thanks. – Marc Stober Apr 17 '12 at 14:05
6

For completeness, you can manage credentials at the command line or in batch script with cmdkey.exe (located in %windir%\system32).


For example, to add (or update) the credentials on server.domain.tld:

cmdkey.exe /add:server.domain.tld /user:username /pass:password

or for the entire domain:

cmdkey.exe /add:*.domain.tld /user:username /pass:password


/user can also take domain\username or username@domain


Instead of opening Windows Vault you could run a simple batch script that would prompt you for your new password:

set /p pw=Enter your new password:
cmdkey.exe /add:*companydomain.tld /user:myusername /pass:%pw%
3

If anyone is interested in reading and writing to it from PowerShell or C#, here's a link to a script that does it:

PowerShell Credentials Manager: CredMan.ps1

The PowerShell script accesses the API via inline C# that utilizes Pinvoke.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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