Cmdkey

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Cmdkey

Creates, lists and deletes stored user names and passwords or credentials.

Syntax

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

Parameters
  • /add
    Adds a user name and password to the list.
  • TargetName
    The computer or domain name that this entry will be associated with.
  • /generic
    Adds generic credentials to the list.
  • /smartcard
    Retrieves the credential from a smart card.
  • /user: UserName
    Specifies the user or account name to store with this entry. If UserName is not supplied, it will be requested.
  • /pass: Password
    Specifies the password to store with this entry. If Password is not supplied, it will be requested.
  • /delete {:TargetName | /ras}
    Deletes a user name 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: TargetName
    Displays the list of stored user names and credentials. If TargetName is not specified, all stored user names and credentials will be listed.
  • /?
    Displays help at the command prompt.
Remarks
  • If more than one smart card is found on the system when the /smartcard option is used, cmdkey will display information about all available smart cards and then prompt the user to specify which one to use.

  • Passwords will not be displayed once they are stored.

Examples

To use cmdkey to display a list of all user names and credentials that are stored, type:

cmdkey /list

To use cmdkey to add a user name and password for user Mikedan to access computer Server01 with the password Kleo, type:

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

To use cmdkey to add a user name and password for user Mikedan to access computer Server01 and prompt for the password whenever Server01 is accessed, type:

cmdkey /add:server /user:mikedan

To delete the credential that remote access has stored, type:

cmdkey /delete /ras

Formatting legend

Format Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

See Also

Concepts

Stored User Names and Passwords
Command shell overview