Share via


New-NetworkControllerCredential

New-NetworkControllerCredential

Adds or modifies a device credential in Network Controller.

Syntax

Parameter Set: Default
New-NetworkControllerCredential [-ResourceId] <String> [-Properties] <CredentialProperties> [[-ResourceMetadata] <ResourceMetadata> ] [[-VersionId] <System.String> ] [[-Force]] -ConnectionUri <String> [-CertificateThumbprint <System.String> ] [-Credential <PSCredential> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detaillierte Beschreibung

The New-NetworkControllerCredential cmdlet adds a new device credential to the Network Controller. If the credential is already present, this cmdlet will modify the properties of the credential. Network Controller uses the device credential to connect to a southbound device for managing the device. This cmdlet adds or modifies credentials based on username and password, Simple Network Management Protocol (SNMP)-based credentials and certificate-based credentials.

Parameter

-CertificateThumbprint<System.String>

Specifies the digital public key X.509 certificate of a user account that has permission to perform this action. This is the certificate thumbprint of the certificate. This thumbprint must also be provided in the ClientCertificateThumbprint parameter in the Install-NetworkController or Set-NetworkController cmdlet so that Network Controller can authorize this user.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-ConnectionUri<String>

Specifies the Uniform Resource Identifier (URI) of the Network Controller, used by all Representational State Transfer (REST) clients to connect to the Network Controller.

Aliase

none

Erforderlich?

true

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Credential<PSCredential>

Specifies a user credential that has permission to perform this action. The default is the current user. This user must be present in the security group provided in the ClientSecurityGroup parameter in the Install-NetworkController cmdlet or the Set-NetworkController cmdlet.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Force

Erzwingt die Ausführung des Befehls, ohne den Benutzer zur Bestätigung aufzufordern.

Aliase

none

Erforderlich?

false

Position?

9

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Properties<CredentialProperties>

This contains details about the Credential resource, such as the type of credential (can be username and password, SNMP community string or certificate), the user name of the resource (only applicable if the type is username and password) and the value of the credential.

Aliase

none

Erforderlich?

true

Position?

4

Standardwert

none

Pipelineeingaben akzeptieren?

true(ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-ResourceId<String>

This is the ID of the credential that will be created or modified.

Aliase

none

Erforderlich?

true

Position?

1

Standardwert

none

Pipelineeingaben akzeptieren?

true(ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-ResourceMetadata<ResourceMetadata>

This parameter contains metadata information for the client, such as the tenant ID, group ID, and resource name.

Aliase

none

Erforderlich?

false

Position?

7

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-VersionId<System.String>

Specifies the entity tag (ETag) parameter of the resource. An ETag (entity tag) is an HTTP response header returned by an HTTP-compliant web server used to determine change in the content of a resource at a given URL. The value of the header is an opaque string representing the state of the resource at the time the response was generated.

Aliase

none

Erforderlich?

false

Position?

8

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Confirm

Fordert Sie vor der Ausführung des Cmdlet zum Bestätigen auf.

Erforderlich?

false

Position?

named

Standardwert

false

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-WhatIf

Zeit, was passieren würde, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.

Erforderlich?

false

Position?

named

Standardwert

false

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

<CommonParameters>

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer und -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Eingaben

Der Eingabetyp ist der Typ der Objekte, die Sie per Piping an das Cmdlet übergeben können.

Ausgaben

Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.

  • This cmdlet outputs the following information:
    -- Resource reference uri
    -- Created time of the resource
    -- Instance ID of the resource
    -- Resource Metadata
    -- Resource ID
    -- Properties of the resource

Beispiele

Example 1: Create a network credential

This command creates a credential object and uses New-NetworkControllerCredential to add it to the network controller.

To get the Properties, put the output of New-NetworkControllerCredential in a variable (for example, x) and execute x.properties in the Powershell prompt.

PS C:\> $cred=New-Object Microsoft.Windows.Networkcontroller.credentialproperties
$cred.type="usernamepassword"
$cred.username="admin"
$cred.value="abcd"

New-NetworkControllerCredential -ConnectionUri "https://restserver" -Properties $Cred –ResourceId "Cred1"

Verwandte Themen

Get-NetworkControllerCredential

Install-NetworkController

Remove-NetworkControllerCredential

Set-NetworkController