0

Currently looking into setting credentials for all the users which are able to login on the machine. But somehow I am not able to do so.

What I have tried is using the solution in this thread: Similar question

So actually setting the account like:

cmdkey /add:Name /user:Username /pass:Password

Which sets the key in the credential manager. But login in with a different user shows me no credential with that name.

Another attempt is by doing it like this, with CredentialManager in C#:

      {
        cred.Password = "password";
        cred.Target = username;
        cred.Type = CredentialType.Generic;
        cred.PersistanceType = PersistanceType.LocalComputer;
        cred.Save();
      }

But then the credentials are still only available for the user which set the credentials. Also tried with Powershell, with the CredentialManager plugin. But with similar results.

Is there the option to set the credentials for ALL users?

Marab
  • 27
  • 3
  • Best way is to create a group account with all users and then use the group for the credentials. Usually in a corporation that users group policies there is already a group account. – jdweng May 09 '23 at 08:51
  • How do you mean? How to set the credentials so it will become available for the whole group? – Marab May 09 '23 at 09:02
  • You do not need to use a username and password. The default credentials will include the group. Then an app can be set to run with any user in the group. – jdweng May 09 '23 at 09:16
  • Credential Manager is per user, so running that will only apply to the current user context. So if you wanted to have that credential available to each user on the machine you'd need to re-run that command in the user context of each individual user. I'd add the script to the Group Policy (either local or domain depending on your setup) in User Configuration > Windows Settings > Scripts (Logon/Logoff) > Logon, so it runs for each user when they login, which will then include both existing users and an future users logging in for the first time. – Keith Langmead May 09 '23 at 09:18
  • @jdweng From the context I think Marab is talking about setting up service credentials within Credential Manager, eg so they can login to an external service using specific credentials, NOT their existing windows credentuals, for instance a 3rd party web service. – Keith Langmead May 09 '23 at 09:20
  • Credentials are stored with an encryption algorithm based on the computer and user account. **This garanties the security of the stored credentials** therefore it is difficult (and not meant) to store a credential under another account. – iRon May 09 '23 at 09:23
  • @KeithLangmead : Most windows systems have username/password disabled. – jdweng May 09 '23 at 11:40
  • Thank you for the answers. Indeed I'm looking for a way to have the credential available for another application. I will investigate the Group Policy option of @KeithLangmead – Marab May 09 '23 at 17:55

0 Answers0