< Back

Get-AzureRmApiManagementUser

Tue Jan 29, 2019 9:29 pm

NAME Get-AzureRmApiManagementUser



SYNOPSIS

Gets a user or users.





SYNTAX

Get-AzureRmApiManagementUser -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-Email <String>] [-FirstName <String>]

[-GroupId <String>] [-LastName <String>] [-State {Active | Blocked}] [<CommonParameters>]



Get-AzureRmApiManagementUser -Context <PsApiManagementContext> [-DefaultProfile <IAzureContextContainer>] [-UserId <String>] [<CommonParameters>]





DESCRIPTION

The Get-AzureRmApiManagementUser cmdlet gets a specified user, or all users, if no user is specified.





PARAMETERS

-Context <PsApiManagementContext>

Specifies an instance of PsApiManagementContext .



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Email <String>

Specifies the email address of the user. If this parameter is specified, this cmdlet finds a user by email. This parameter is optional.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-FirstName <String>

Specifies the first name of the user. If this parameter is specified, this cmdlet finds a user by first name. This parameter is optional.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-GroupId <String>

Specifies the group identifier. If specified, this cmdlet finds all users within the specified group. This parameter is optional.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-LastName <String>

Specifies the last name of a user. If specified, this cmdlet finds users by last name. This parameter is optional.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-State <PsApiManagementUserState>

Specifies the user state. If specified, this cmdlet finds users in this state. This parameter is optional.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-UserId <String>

Specifies a user ID. If specified, this cmdlet finds the user by this identifier. This parameter is optional.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser

The details of User in API Management service.



IList<Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementUser>

The list of User in the API Management service.





NOTES









Example 1: Get all users



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

PS C:\\>Get-AzureRmApiManagementUser -Context $apimContext



This command gets all users.





Example 2: Get a user by ID



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

PS C:\\>Get-AzureRmApiManagementUser -Context $apimContext -UserId "0123456789"



This command gets a user by ID.





Example: Get users by last name



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

PS C:\\>Get-AzureRmApiManagementUser -Context $apimContext -LastName "Fuller"



This command gets users that have a specified last name, Fuller.





Example 4: Get a user by email address



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

PS C:\\>Get-AzureRmApiManagementUser -Context $apimContext -Email "user@contoso.com"



This command gets the user that has the specified email address.





Example 5: Get all users within a group



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

PS C:\\>Get-AzureRmApiManagementUser -Context $apimContext -GroupId "0001"



This command gets all users within the specified group.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... gementuser

New-AzureRmApiManagementUser

Remove-AzureRmApiManagementUser

Set-AzureRmApiManagementUser