Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Manage Credentials in Windows Using Credential Manager

Credential Manager is a feature in Windows that allows users to store credentials, such as usernames and passwords, for various network resources, websites, and applications. This article will guide you through the process of managing credentials using the Credential Manager in Windows, including how to add, edit, and remove credentials. Additionally, we will explore how to perform these tasks via Command Prompt (CMD) and PowerShell.

Accessing Credential Manager

Using the Control Panel

  1. Open the Control Panel.
  2. Navigate to "User Accounts".
  3. Click on "Credential Manager".

Using the Search Bar

  1. Click on the Start menu.
  2. Type "Credential Manager" in the search bar and press Enter.

Adding a Credential

Via the GUI

  1. Open Credential Manager.
  2. Click on "Windows Credentials" or "Web Credentials" depending on the type of credential you want to add.
  3. Click on "Add a Windows credential" or "Add a generic credential".
  4. Enter the required information (Internet or network address, username, and password).
  5. Click "OK" to save the credential.

Via CMD

While Credential Manager does not have direct CMD commands for adding credentials, you can use cmdkey to manage credentials. Here’s how to add a credential:

cmdkey /add:TARGET_NAME /user:USERNAME /pass:PASSWORD

Replace TARGET_NAME with the name of the resource, USERNAME with your username, and PASSWORD with your password.

Via PowerShell

You can use the New-StoredCredential cmdlet from the CredentialManager module. First, you need to install the module:

Install-Module -Name CredentialManager -Scope CurrentUser

Then, add a credential:

$cred = New-Object -TypeName PSCredential -ArgumentList "USERNAME", (ConvertTo-SecureString "PASSWORD" -AsPlainText -Force)
New-StoredCredential -Target "TARGET_NAME" -Credential $cred

Replace TARGET_NAME, USERNAME, and PASSWORD with your respective values.

Editing a Credential

Via the GUI

  1. Open Credential Manager.
  2. Locate the credential you want to edit.
  3. Click on the credential to expand it.
  4. Click "Edit".
  5. Modify the details as needed and click "Save".

Via CMD or PowerShell

To edit a credential, you generally need to delete the existing one and add a new one with the updated details.

Removing a Credential

Via the GUI

  1. Open Credential Manager.
  2. Locate the credential you want to remove.
  3. Click on the credential to expand it.
  4. Click "Remove".

Via CMD

cmdkey /delete:TARGET_NAME

Replace TARGET_NAME with the name of the resource.

Via PowerShell

Remove-StoredCredential -Target "TARGET_NAME"

Replace TARGET_NAME with the name of the resource.

Practical Examples

Example 1: Adding a Windows Credential via CMD

cmdkey /add:myserver.local /user:admin /pass:password123

Example 2: Adding a Generic Credential via PowerShell

$cred = New-Object -TypeName PSCredential -ArgumentList "admin", (ConvertTo-SecureString "password123" -AsPlainText -Force)
New-StoredCredential -Target "myapp" -Credential $cred

Example 3: Removing a Credential via CMD

cmdkey /delete:myserver.local

Example 4: Removing a Credential via PowerShell

Remove-StoredCredential -Target "myapp"

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.