Bearbeiten

Freigeben über


Add-AzIoTDeviceProvisioningServiceEnrollment

Create a device enrollment record.

Syntax

Add-AzIoTDeviceProvisioningServiceEnrollment
   [-ResourceGroupName] <String>
   [-DpsName] <String>
   -RegistrationId <String>
   -AttestationType <PSAttestationMechanismType>
   [-DeviceId <String>]
   [-EndorsementKey <String>]
   [-StorageRootKey <String>]
   [-PrimaryKey <String>]
   [-SecondaryKey <String>]
   [-PrimaryCertificate <String>]
   [-SecondaryCertificate <String>]
   [-RootCertificate]
   [-PrimaryCAName <String>]
   [-SecondaryCAName <String>]
   [-ReprovisionPolicy <PSReprovisionType>]
   [-EdgeEnabled]
   [-Tag <Hashtable>]
   [-Desired <Hashtable>]
   [-AllocationPolicy <PSAllocationPolicy>]
   [-ProvisioningStatus <PSProvisioningStatus>]
   [-IotHubHostName <String>]
   [-IotHub <String[]>]
   [-WebhookUrl <String>]
   [-ApiVersion <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Add-AzIoTDeviceProvisioningServiceEnrollment
   [-DpsObject] <PSProvisioningServiceDescription>
   -RegistrationId <String>
   -AttestationType <PSAttestationMechanismType>
   [-DeviceId <String>]
   [-EndorsementKey <String>]
   [-StorageRootKey <String>]
   [-PrimaryKey <String>]
   [-SecondaryKey <String>]
   [-PrimaryCertificate <String>]
   [-SecondaryCertificate <String>]
   [-RootCertificate]
   [-PrimaryCAName <String>]
   [-SecondaryCAName <String>]
   [-ReprovisionPolicy <PSReprovisionType>]
   [-EdgeEnabled]
   [-Tag <Hashtable>]
   [-Desired <Hashtable>]
   [-AllocationPolicy <PSAllocationPolicy>]
   [-ProvisioningStatus <PSProvisioningStatus>]
   [-IotHubHostName <String>]
   [-IotHub <String[]>]
   [-WebhookUrl <String>]
   [-ApiVersion <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Add-AzIoTDeviceProvisioningServiceEnrollment
   [-ResourceId] <String>
   -RegistrationId <String>
   -AttestationType <PSAttestationMechanismType>
   [-DeviceId <String>]
   [-EndorsementKey <String>]
   [-StorageRootKey <String>]
   [-PrimaryKey <String>]
   [-SecondaryKey <String>]
   [-PrimaryCertificate <String>]
   [-SecondaryCertificate <String>]
   [-RootCertificate]
   [-PrimaryCAName <String>]
   [-SecondaryCAName <String>]
   [-ReprovisionPolicy <PSReprovisionType>]
   [-EdgeEnabled]
   [-Tag <Hashtable>]
   [-Desired <Hashtable>]
   [-AllocationPolicy <PSAllocationPolicy>]
   [-ProvisioningStatus <PSProvisioningStatus>]
   [-IotHubHostName <String>]
   [-IotHub <String[]>]
   [-WebhookUrl <String>]
   [-ApiVersion <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Create a device enrollment in an Azure IoT Hub Device Provisioning Service.

Examples

Example 1

Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType SymmetricKey

Create an enrollment with attestation type SymmetricKey

Example 2

Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType Tpm -EndorsementKey "endorementkey"

Create an enrollment with TPM attestation.

Example 3

Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType X509 -PrimaryCertificate "D:/primary.cer"

Create an enrollment with attestation type X509

Example 4

$tag = @{}
$tag.Add("environment","test")
$desired = @{}
$desired.add("version_dps", "dps1")
Add-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AttestationType SymmetricKey -tag $tag -Desired $desired

Create an enrollment with attestation type SymmetricKey and initial twin state.

Parameters

-AllocationPolicy

Type of allocation for device assigned to the Hub.

Type:PSAllocationPolicy
Accepted values:Hashed, GeoLatency, Static, Custom
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ApiVersion

The API version of the provisioning service in the custom allocation request.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AttestationType

Attestation Mechanism.

Type:PSAttestationMechanismType
Accepted values:None, Tpm, X509, SymmetricKey
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Desired

Initial twin desired properties.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DeviceId

IoT Hub Device ID.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DpsName

Name of the IoT Device Provisioning Service

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

-DpsObject

IoT Device Provisioning Service Object

Type:PSProvisioningServiceDescription
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-EdgeEnabled

Flag indicating edge enablement.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EndorsementKey

TPM endorsement key for a TPM device.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IotHub

Host name of target IoT Hub. Use space-separated list for multiple IoT Hubs.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IotHubHostName

Host name of the target IoT Hub.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PrimaryCAName

The name of the primary root CA certificate. If attestation with a root CA certificate is desired then a root ca name must be provided.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PrimaryCertificate

The path to the file containing the primary certificate. Base-64 representation of X509 certificate .cer file or .pem file path.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PrimaryKey

The primary symmetric shared access key stored in base64 format.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ProvisioningStatus

Enable or disable enrollment entry.

Type:PSProvisioningStatus
Accepted values:Enabled, Disabled
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RegistrationId

Individual enrollment registration id.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ReprovisionPolicy

Device data to be handled on re-provision to different Iot Hub.

Type:PSReprovisionType
Accepted values:reprovisionandmigratedata, reprovisionandresetdata, never
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Name of the Resource Group

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

IoT Device Provisioning Service Resource Id

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RootCertificate

Allows to create X509attestation using root certificates.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SecondaryCAName

The name of the secondary root CA certificate. If attestation with a root CA certificate is desired then a root ca name must be provided.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SecondaryCertificate

The path to the file containing the secondary certificate. Base-64 representation of X509 certificate .cer file or .pem file path.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SecondaryKey

The secondary symmetric shared access key stored in base64 format.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StorageRootKey

TPM storage root key for a TPM device.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Tag

Initial twin tags.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WebhookUrl

The webhook URL used for custom allocation requests.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSProvisioningServiceDescription

String

Outputs

PSIndividualEnrollment