Skip to content

Set-VCFCredential

Synopsis

Updates or rotate a credential.

Syntax

Set-VCFCredential [-json] <String> [<CommonParameters>]

Description

The Set-VCFCredential cmdlet updates or rotates a credential.

Info

Credentials can be updated with a specified password(s) or rotated using system generated password(s).

Examples

Example 1

Set-VCFCredential -json .\samples\credentials\updateCredentialSpec.json

This example shows how to update a credential using a JSON specification file.

Sample JSON: Update Credential
{
  "operationType" : "UPDATE",
  "elements" : [ {
    "resourceName" : "sfo01-m01-esx01.sfo.rainpole.io",
    "resourceType" : "ESXI",
    "credentials" : [ {
      "credentialType" : "SSH",
      "username" : "root",
      "password" : "VMw@re1!"
    } ]
  } ]
}

Example 2

Set-VCFCredential -json .\samples\credentials\rotateCredentialSpec.json

This example shows how to rotate a credential using a JSON specification file.

Sample JSON: Rotate Credential
{
  "operationType" : "ROTATE",
  "elements" : [ {
    "resourceName" : "sfo01-m01-esx01.sfo.rainpole.io",
    "resourceType" : "ESXI",
    "credentials" : [ {
      "credentialType" : "SSH",
      "username" : "root"
    } ]
  } ]
}

Parameters

-json

Specifies the JSON specification to be used.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Common Parameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.