Dela via


Get-AzIotHubDeviceConnectionString

Hämta niska veze för en IoT-målenhet i en Iot Hub.

Syntax

Get-AzIotHubDeviceConnectionString
   [-ResourceGroupName] <String>
   [-IotHubName] <String>
   [-DeviceId <String>]
   [-KeyType <PSKeyType>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzIotHubDeviceConnectionString
   [-InputObject] <PSIotHub>
   [-DeviceId <String>]
   [-KeyType <PSKeyType>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzIotHubDeviceConnectionString
   [-ResourceId] <String>
   [-DeviceId <String>]
   [-KeyType <PSKeyType>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Lista niska veze för alla enheter eller en IoT-målenhet som finns i en Azure IoT Hub.

Exempel

Exempel 1

Get-AzIotHubDeviceConnectionString -ResourceGroupName "myresourcegroup" -IotHubName "myiothub"

Device Id Connection String
--------- -----------------
device1   HostName=myiothub.azure-devices.net;DeviceId=device1;SharedAccessKey=/X4y******     
device2   HostName=myiothub.azure-devices.net;DeviceId=device2;x509=true

Visa alla enheter niska veze i en Iot Hub.

Exempel 2

Get-AzIotHubDeviceConnectionString -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -DeviceId "device1" -KeyType secondary

Device Id Connection String
--------- -----------------
device1   HostName=myiothub.azure-devices.net;DeviceId=device1;SharedAccessKey=/X4y******

Hämta den sekundära niska veze för en IoT-enhet.

Parametrar

-DefaultProfile

Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.

Typ:IAzureContextContainer
Alias:AzContext, AzureRmContext, AzureCredential
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-DeviceId

Målenhets-ID.

Typ:String
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-InputObject

IotHub-objekt

Typ:PSIotHub
Position:0
Standardvärde:None
Obligatorisk:True
Godkänn pipeline-indata:True
Godkänn jokertecken:False

-IotHubName

Namnet på Iot Hub

Typ:String
Position:1
Standardvärde:None
Obligatorisk:True
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-KeyType

Nyckeltyp för princip för delad åtkomst för autentisering.

Typ:PSKeyType
Godkända värden:primary, secondary
Position:Named
Standardvärde:None
Obligatorisk:False
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-ResourceGroupName

Namnet på resursgruppen

Typ:String
Position:0
Standardvärde:None
Obligatorisk:True
Godkänn pipeline-indata:False
Godkänn jokertecken:False

-ResourceId

IotHub-resurs-ID

Typ:String
Position:0
Standardvärde:None
Obligatorisk:True
Godkänn pipeline-indata:True
Godkänn jokertecken:False

Indata

PSIotHub

String

Utdata

PSDeviceConnectionString