共用方式為


Update-AzCosmosDBMongoDBUserDefinition

更新現有的 CosmosDB MongoDB 用戶定義。

語法

Update-AzCosmosDBMongoDBUserDefinition
      -Id <String>
      -UserName <String>
      -Password <String>
      [-Mechanisms <String>]
      -DatabaseName <String>
      -Roles <System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.CosmosDB.Models.MongoDB.PSMongoRole]>
      [-CustomData <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzCosmosDBMongoDBUserDefinition
      -ResourceGroupName <String>
      -AccountName <String>
      -Id <String>
      -UserName <String>
      -Password <String>
      [-Mechanisms <String>]
      -DatabaseName <String>
      -Roles <System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.CosmosDB.Models.MongoDB.PSMongoRole]>
      [-CustomData <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzCosmosDBMongoDBUserDefinition
      -Id <String>
      -UserName <String>
      -Password <String>
      [-Mechanisms <String>]
      -DatabaseName <String>
      -Roles <System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.CosmosDB.Models.MongoDB.PSMongoRole]>
      [-CustomData <String>]
      -DatabaseAccountObject <PSDatabaseAccountGetResults>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzCosmosDBMongoDBUserDefinition
      -Id <String>
      -UserName <String>
      -Password <String>
      [-Mechanisms <String>]
      -DatabaseName <String>
      -Roles <System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.CosmosDB.Models.MongoDB.PSMongoRole]>
      [-CustomData <String>]
      -DatabaseAccountObject <PSDatabaseAccountGetResults>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzCosmosDBMongoDBUserDefinition
      -Id <String>
      -UserName <String>
      -Password <String>
      [-Mechanisms <String>]
      -DatabaseName <String>
      -Roles <System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.CosmosDB.Models.MongoDB.PSMongoRole]>
      [-CustomData <String>]
      [-ResourceId <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

更新現有的 CosmosDB MongoDB 用戶定義。 若要指定角色定義的角色,請使用 New-AzCosmosDBMongoDBRole Cmdlet 來建立 PSMongoRole 物件,以透過 Roles 參數傳入。

範例

範例 1:預設值

$Roles = New-AzCosmosDBMongoDBRole -Database test -Role roleName


Update-AzCosmosDBMongoDBUserDefinition `
	-AccountName accountName `
	-ResourceGroupName resourceGroupName `
	-DatabaseName 'test' `
	-UserName 'myName' `
	-Password 'pass' `
	-Id id `
	-Mechanisms 'SCRAM-SHA-256' `
	-CustomData 'test' `
	-Roles $Roles

Id           : /subscriptions/80be3961-0521-4a0a-8570-5cd5a4e2f98c/resourceGroups/mongorbactest02/providers/Microsoft.DocumentDB/databaseAccounts/ashwini001/mongodbUserDefinitions/test.testuser1
UserName     : testuser1
Password     :
Mechanisms   : SCRAM-SHA-256
DatabaseName : test
CustomData   :
Roles        : {Microsoft.Azure.Management.CosmosDB.Models.Role}

參數

-AccountName

Cosmos DB 資料庫帳戶的名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

-CustomData

用戶定義的其他資訊。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DatabaseAccountObject

角色定義物件。

類型:PSDatabaseAccountGetResults
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-DatabaseName

MongoDB 角色定義的資料庫名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Id

角色定義唯一標識碼(格式為 <databaseName>.<roleName>)。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Mechanisms

使用者定義的密碼。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Password

使用者定義的密碼。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ResourceGroupName

資源組名。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ResourceId

資源的 ResourceId。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Roles

CosmosDB MongoDB API 角色定義的繼承角色集。

類型:List<T>[PSMongoRole]
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-UserName

使用者定義的唯一用戶名稱(每個資料庫)。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

輸出

Microsoft.Azure.Commands.CosmosDB.Models.PSMongoDBUserDefinitionGetResults