Cmdkey command in Windows

  1. Applies to: Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012.

The cmdkey command creates, lists and deletes stored usernames and passwords or stored login information.

Syntax cmdkey command

 cmdkey [{/add:|/generic:}] {/smartcard|/user: [/pass:]} [/delete{:|/ras}] /list: 

Parameters

Parameter Description / add:

Add a username and password to the list.

Parameter request identifies the computer or domain that this entry will be linked to.

/ generic:

Add general login information to the list.

Parameter request identifies the computer or domain that this entry will be linked to.

/ smartcard Retrieve authentication information from smart card. / user: Specify the username or account to store with this entry. If the UserName entry is not filled, it will be requested. / pass: Specify a password to store with this entry. If the Password item has not been filled, it will be requested. / delete {: | / ras} Delete the username and password from the list. If TargetName is specified, that entry will be deleted. If / ras is specified, the stored remote access entry will be deleted. / list: Displays a list of stored username and login information. If the TargetName is not specified, all stored username and login information will be listed. /? Show help at the command prompt.

Note

  1. If multiple smart cards are found on the system when the / smartcard command line option is used, cmdkey will display information about all available smart cards and then prompt the user to specify which smart card to use.
  2. The password will not be displayed when they are stored.

For example

To display a list of all stored usernames and login information, enter:

 cmdkey /list 

To add a username and password to Mikedan users to access Server01 computer with password Kleo, enter:

 cmdkey /add:server01 /user:mikedan /pass:Kleo 

To add a username and password to Mikedan users to access the Server01 server and prompt the password whenever Server01 is accessed, enter:

 cmdkey /add:server01 /user:mikedan 

To delete credentials that remote access has saved, enter:

 cmdkey /delete /ras 

To delete stored authentication information for Server01, enter:

 cmdkey /delete:Server01 

See more:

  1. The bootcfg addsw command in Windows
  2. The bootcfg timeout command in Windows
  3. The bootcfg rmsw command in Windows
4 ★ | 30 Vote

May be interested

  • Color command in WindowsPhoto of Color command in Windows
    the color command changes the foreground and background colors in the command prompt window for the current session. if used without parameters, the color command restores the default foreground and background colors of the command prompt window.
  • What is a disk signature? Fix disk signature conflict errorPhoto of What is a disk signature?  Fix disk signature conflict error
    a disk signature is a unique, defined number of a hard drive or data storage device, stored as part of the master boot record (mbr).
  • Command mode in WindowsPhoto of Command mode in Windows
    display system status, change system settings or reconfigure port and connected device.
  • The ntfrsutl command in WindowsPhoto of The ntfrsutl command in Windows
    (applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012).
  • Cd command in WindowsPhoto of Cd command in Windows
    the cd command displays the name or changes the current directory. if used only with a drive letter (eg cd c :), the cd command displays the name of the current directory in the specified drive.
  • Openfiles commands in WindowsPhoto of Openfiles commands in Windows
    allows administrators to query, display, or disconnect files and folders that have been opened on the system. in addition, this command can also license or disable the maintain objects list system.