Set-AzIoTDeviceProvisioningServiceEnrollment

Update a device enrollment record.

Syntax

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

Description

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

Examples

Example 1

Set-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -AllocationPolicy Hashed -IotHub "hub1","hub2"

Update allocation policy and hubs for an enrollment record.

Example 2

$tag = @{}
$tag.Add("environment","updatedenv")
$desired = @{}
$desired.add("version_dps", "updateddps")
Set-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -tag $tag -Desired $desired

Update an enrollment's initial twin state.

Example 3

Set-AzIoTDeviceProvisioningServiceEnrollment -ResourceGroupName "myresourcegroup" -DpsName "mydps" -RegistrationId "enroll1" -PrimaryCertificate ".\primaryCertificate.cer" -SecondaryCertificate ".\secondaryCertificate.cer"

Update a symmetric key enrollment's primary and secondary certificates

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

-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:Boolean
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

Switch to update 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