Edit

Share via


New-AzApiManagementUser

Registers a new user.

Syntax

Default (Default)

New-AzApiManagementUser
    -Context <PsApiManagementContext>
    [-UserId <String>]
    -FirstName <String>
    -LastName <String>
    -Email <String>
    -Password <SecureString>
    [-State <PsApiManagementUserState>]
    [-Note <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The New-AzApiManagementUser cmdlet registers a new user.

Examples

Example 1: Register a new user

$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
$securePassword = ConvertTo-SecureString -String "****" -AsPlainText -Force
New-AzApiManagementUser -Context $apimContext -FirstName "Patti" -LastName "Fuller" -Email "[email protected]" -Password $securePassword

This command registers a new user named Patti Fuller.

Parameters

-Context

Specifies a PsApiManagementContext object.

Parameter properties

Type:PsApiManagementContext
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Email

Specifies the email address of the user.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-FirstName

Specifies the first name of the user. This parameter must be 1 to 100 characters long.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-LastName

Specifies the last name of the user. This parameter must be 1 to 100 characters long.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Note

Specifies a note about the user. This parameter is optional. The default value is $Null.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Password

Specifies the user password. This parameter is required.

Parameter properties

Type:SecureString
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-State

Specifies the user state. This parameter is optional. The default value of this parameter is $Null.

Parameter properties

Type:

Nullable<T>[PsApiManagementUserState]

Default value:None
Accepted values:Active, Blocked, Deleted, Pending
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-UserId

Specifies the user ID. This parameter is optional. If this parameter is not specified, this cmdlet generates a user ID.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PsApiManagementContext

String

SecureString

Nullable<T>

Outputs

PsApiManagementUser