你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzApiManagementUser
获取用户或用户。
语法
Get-AzApiManagementUser
-Context <PsApiManagementContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzApiManagementUser
-Context <PsApiManagementContext>
[-UserId <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzApiManagementUser
-Context <PsApiManagementContext>
[-FirstName <String>]
[-LastName <String>]
[-State <PsApiManagementUserState>]
[-Email <String>]
[-GroupId <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzApiManagementUser cmdlet 获取指定用户或所有用户(如果未指定用户)。
示例
示例 1:获取所有用户
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementUser -Context $apimContext
此命令获取所有用户。
示例 2:按 ID 获取用户
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementUser -Context $apimContext -UserId "0123456789"
此命令按 ID 获取用户。
示例 3:按姓氏获取用户
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementUser -Context $apimContext -LastName "Fuller"
此命令可获取具有指定姓氏 Fuller 的用户。
示例 4:通过电子邮件获取用户
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementUser -Context $apimContext -Email "user@contoso.com"
此命令获取具有指定电子邮件地址的用户。
示例 5:获取组中的所有用户
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementUser -Context $apimContext -GroupId "0001"
此命令获取指定组中的所有用户。
参数
-Context
指定 PsApiManagementContext的实例。
类型: | PsApiManagementContext |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
指定用户的电子邮件地址。 如果指定此参数,则此 cmdlet 通过电子邮件查找用户。 此参数是可选的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-FirstName
指定用户的名字。 如果指定此参数,则此 cmdlet 按名字查找用户。 此参数是可选的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-GroupId
指定组标识符。 如果指定,此 cmdlet 将查找指定组中的所有用户。 此参数是可选的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-LastName
指定用户的姓氏。 如果指定,则此 cmdlet 按姓氏查找用户。 此参数是可选的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-State
指定用户状态。 如果指定,此 cmdlet 将查找处于此状态的用户。 此参数是可选的。
类型: | Nullable<T>[PsApiManagementUserState] |
接受的值: | Active, Blocked, Deleted, Pending |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-UserId
指定用户 ID。 如果指定,则此 cmdlet 通过此标识符查找用户。 此参数是可选的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
输入
Nullable<T>[[Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUserState, Microsoft.Azure.PowerShell.Cmdlets.ApiManagement.ServiceManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]