Add-SmCredential
Register the credential with SnapCenter Server.
Syntax
Add-SmCredential [-Name] <String> [-Type] <SmAuthMode> [-ClientSecret] <SecureString> [-TenantId] <String> [-ClientId] <String> [-InstanceName] <String> [-Credential] <PSCredential> [-EnableSudoPrevileges] <Boolean> [-AuthenticationType] <SmAuthenticationType> [-Force] <>
Detailed Description
Register the credential with SnapCenter Server. The credentials can be for other plug-ins or for other NetApp cloud storage.
Parameters
Name | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|
Name |
Specifies the name of the Credential Account. |
true |
true (ByPropertyName) |
|
Type |
Specifies the authentication mode. |
false |
true (ByPropertyName) |
|
ClientSecret |
Specifies the Azure NetApp client secret. |
false |
true (ByPropertyName) |
|
TenantId |
Specifies the Azure NetApp tenant ID. |
false |
true (ByPropertyName) |
|
ClientId |
Specifies the Azure NetApp client ID. |
false |
true (ByPropertyName) |
|
InstanceName |
false |
true (ByPropertyName) |
||
Credential |
true |
true (ByPropertyName) |
||
EnableSudoPrevileges |
false |
true (ByPropertyName) |
||
Force |
false |
true (ByPropertyName) |
Examples
Example 1: Create Credential
Add-SmCredential -Name RunAs1 -Type Windows -Credential $cred
Example 2: Create Azure Credential
$clientSecretText = 'd7c7656b-a07a-4es5-b19e-12376bdef493'; $secureString = ConvertTo-SecureString $clientSecretText -AsPlainText -Force; Add-SmCredential -Name azure1 -Type AzureCredential -ClientSecret $secureString -TenantId c8f6a9b7-8cc7-445b-ac6f-f6e8e13f1ebb -ClientId ecadcfb7-b4f1-425f-ae93-bb1ee6084475
Note: Add-SmCredential with AzureCredential requires the following mandatory parameters ClientSecret, TenantId, and ClientId.
Example 3: Create AIX Credential
Add-SmCredential -Name RunAs2 -CredentialType AIX -Credential $cred
Example 4: Create Linux credential with SSH based authentication
Add-SmCredential -Name linuxSshBasedRunAs -Type Linux -AuthenticationType SshKeyBased -Username scanf -SSHPrivateKeyPath "C:\Users\Administrator\passwordfile.txt" -EnableSudoPrevileges $true
Note: Add-SmCredential with AuthenticationType as "SshKeyBased" requires the following mandatory parameters Username and SSHPrivateKeyPath(file path which contains private SSH key). By default AuthenticationType is "PasswordBased" which continues to take username and password.