set_default_pref_cred

Sets a named credential as a default preferred credential. If you decide to use preferred credentials for an Enterprise Manager operation and preferred credentials are not set for the target, the default credentials for this target type that you set are used. Default credentials are set at the target-type level.

Format

emcli set_default_pref_cred 
        -set_name="set_name"
        -target_type="ttype"
        -credential_name="cred_name"
        [-credential_owner ="owner]"
        [-test] 
        [-test_target_name="test_target_name"]

[ ]  indicates that the parameter is optional

Options

  • set_name

    Sets the preferred credential for this credential set.

  • target_type

    Target type for the credential set.

  • credential_name

    Name of the credential.

  • credential_owner

    Owner of the credential. This defaults to the currently logged-in user.

  • test

    Tests the credential before setting it as the default credential.

  • test_target_name

    Tests the target name if the global credential is set as the default preferred credential.

Examples

Example 1

This example sets the named credential MyHostCredentials as the default preferred credential for the target type host as HostCredsNormal.

emcli set_default_pref_credential 
        -set_name=HostCredsNormal
        -target_type=host
        -credential_name=MyHostCredentials
        -credential_owner="Joe"

Example 2

This example sets the named credential MyHostCredentials as the default preferred credential for the target type host as HostCredsNormal. The command tests the named credential MyHostCredentials against server1.example.com before setting it as a default preferred credential.

emcli set_default_pref_cred 
        -set_name=HostCredsNormal
        -target_type=host
        -credential_name=MyHostCredential
        -credential_owner="Joe"
        -test
        -test_target_name=server1.example.com