편집

다음을 통해 공유


Set-AzApiManagementUser

Sets user details.

Syntax

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

Description

The Set-AzApiManagementUser cmdlet sets user details.

Examples

Example 1: Change a user's password, email address and state

$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
$securePassword = ConvertTo-SecureString -String "****" -AsPlainText -Force
Set-AzApiManagementUser -Context $apimContext -UserId "0123456789" -Email "patti.fuller@contoso.com" -Password $securePassword -State "Blocked"

This command sets a new user password and email address and blocks the user.

Example 2

Sets user details. (autogenerated)

Set-AzApiManagementUser -Context <PsApiManagementContext> -Email 'patti.fuller@contoso.com' -FirstName 'Patti' -LastName 'Fuller' -Password <SecureString> -State Active -UserId '0123456789'

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Context

Specifies a PsApiManagementContext object. This parameter is required.

Type:PsApiManagementContext
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Email

Specifies the email address of the user. This parameter is optional.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-FirstName

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

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-LastName

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

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Note

Specifies a note about the user. This parameter is optional. The default value of this parameter is $null.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PassThru

passthru

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Password

Specifies the user password. This parameter is optional.

Type:SecureString
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-State

Specifies the user state. This parameter is optional. The default value is Active.

Type:PsApiManagementUserState
Accepted values:Active, Blocked, Deleted, Pending
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-UserId

Specifies the user ID. This parameter is required.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PsApiManagementContext

String

SecureString

PsApiManagementUserState

SwitchParameter

Outputs

PsApiManagementUser