I have a software build and deployment service installed on a computer. The service has been setup to run as the SYSTEM account.

Since the service deploys to a number of other machines and requires the passwords of the machines to connect, I would like cache the credentials for the remote machines using the Windows credential manager.

How do I achieve this when the target account is the SYSTEM account?

I would like a solution that does not require me to download any third party tools and works using the default Windows 10 architecture.

Web searches for the problem came up with results on how to clear the credentials for other accounts.


Use the built-in utility cmdkey to add the credentials.

Download and use the Microsoft Sysinternals utility PsExec: psexec -s to run a cmdkey as SYSTEM. Technically, it's Microsoft, therefore not third-party.

CMDKEY.exe Create, list or delete stored user names, passwords or credentials.

      cmdkey [{/add:TargetName|/generic:TargetName}]
         {/smartcard|/user:UserName [/pass:Password]}


Display a list of stored user names and credentials:
cmdkey /list

Add a generic TERMSRV credential for user PeteZ (on domain dom64) to access the computer Server64:
cmdkey /generic:TERMSRV/Server64 /user:dom64\PeteZ /pass:p4g67hjyy23

Delete the stored TERMSRV credential for Server64:
cmdkey /delete TERMSRV/Server64

Add a user name and password for user Kate to access computer Server64 with the password z5rd63hGtjH7:
cmdkey /add:server64 /user:Kate /pass:z5rd63hGtjH7

Add a user name for user Kate to access computer Server64 and prompt for a password whenever Server64 is accessed:
cmdkey /add:server64 /user:Kate

Delete the stored credential for Server64:
cmdkey /delete:Server64

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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