次の方法で共有


Get-AzureRmApiManagementSubscription

サブスクリプションを取得します。

警告

AzureRM PowerShell モジュールは、2024 年 2 月 29 日の時点で正式に非推奨になりました。 引き続きサポートを受け、更新を受け取れるようにするために、AzureRM から Az PowerShell モジュールに移行することをお勧めします。

AzureRM モジュールは引き続き機能する可能性がありますが、メインが維持またはサポートされなくなり、ユーザーの判断とリスクで引き続き使用できます。 Az モジュールへの移行に関するガイダンスについては、移行リソースを参照してください。

構文

Get-AzureRmApiManagementSubscription
   -Context <PsApiManagementContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmApiManagementSubscription
   -Context <PsApiManagementContext>
   [-SubscriptionId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmApiManagementSubscription
   -Context <PsApiManagementContext>
   [-UserId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmApiManagementSubscription
   -Context <PsApiManagementContext>
   [-ProductId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

説明

Get-AzureRmApiManagementSubscription コマンドレットは、サブスクリプションが指定されていない場合は、指定されたサブスクリプションまたはすべてのサブスクリプションを取得します。

例 1: すべてのサブスクリプションを取得する

PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Get-AzureRmApiManagementSubscription -Context $apimContext

このコマンドは、すべてのサブスクリプションを取得します。

例 2: 指定した ID を持つサブスクリプションを取得する

PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Get-AzureRmApiManagementSubscription -Context $apimContext -SubscriptionId "0123456789"

このコマンドは、ID でサブスクリプションを取得します。

例 3: ユーザーのすべてのサブスクリプションを取得する

PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Get-AzureRmApiManagementSubscription -Context $apimContext -UserId "777"

このコマンドは、ユーザーのサブスクリプションを取得します。

例 4: 製品のすべてのサブスクリプションを取得する

PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Get-AzureRmApiManagementSubscription -Context $apimContext -ProductId "999"

このコマンドは、製品のすべてのサブスクリプションを取得します。

パラメーター

-Context

PsApiManagementContext オブジェクトを指定します。

型:PsApiManagementContext
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

-DefaultProfile

Azure との通信に使用される資格情報、アカウント、テナント、サブスクリプション。

型:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
配置:Named
規定値:None
必須:False
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

-ProductId

製品識別子を指定します。 指定した場合、このコマンドレットは製品識別子によってすべてのサブスクリプションを検索します。

型:String
配置:Named
規定値:None
必須:False
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

-SubscriptionId

サブスクリプション識別子を指定します。 指定した場合、このコマンドレットは識別子によってサブスクリプションを検索します。

型:String
配置:Named
規定値:None
必須:False
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

-UserId

ユーザー識別子を指定します。 指定した場合、このコマンドレットはユーザー識別子によってすべてのサブスクリプションを検索します。

型:String
配置:Named
規定値:None
必須:False
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

入力

PsApiManagementContext

String

出力

PsApiManagementSubscription