New-AzCosmosDBMongoDBUserDefinition
Hiermee maakt u een nieuwe CosmosDB MongoDB-gebruikersdefinitie.
Syntaxis
New-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>]
New-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>]
New-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>]
New-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>]
New-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
Hiermee maakt u een nieuwe CosmosDB MongoDB-gebruikersdefinitie. Als u de rollen van de roldefinitie wilt opgeven, gebruikt u de cmdlet New-AzCosmosDBMongoDBRole om PSMongoRole-objecten te maken die moeten worden doorgegeven via de parameter Rollen.
Voorbeelden
Voorbeeld 1: Standaard
$Roles = New-AzCosmosDBMongoDBRole -Database test -Role roleName
New-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}
Voorbeeld 2: ParentObject
$DatabaseAccount = Get-AzCosmosDBAccount -Name accountName -ResourceGroupName resourceGroupName
$Actions = 'insert', 'find'
$PrivilegeResource = New-AzCosmosDBMongoDBPrivilegeResource -Database test -Collection test
$Privilege = New-AzCosmosDBMongoDBPrivilege -PrivilegeResource $PrivilegeResource -Actions $Actions
$Roles = New-AzCosmosDBMongoDBRole -Database test -Role roleName
New-AzCosmosDBMongoDBRoleDefinition `
-Id id `
-Type CustomRole `
-RoleName roleName `
-Privileges $Privilege `
-Roles $Roles `
-DatabaseAccountObject $DatabaseAccount
Id : /subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/id
RoleName : roleName
Type : CustomRole
DatabaseName : test
Privileges : {Microsoft.Azure.Management.CosmosDB.Models.Privilege}
Roles : {Microsoft.Azure.Management.CosmosDB.Models.Role, Microsoft.Azure.Management.CosmosDB.Models.Role}
Parameters
-AccountName
Naam van het Cosmos DB-databaseaccount.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Confirm
U wordt gevraagd om bevestiging voordat u de cmdlet uitvoert.
Type: | SwitchParameter |
Aliassen: | cf |
Position: | Named |
Default value: | False |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-CustomData
Aanvullende informatie over de gebruikersdefinitie.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-DatabaseAccountObject
Roldefinitieobject.
Type: | PSDatabaseAccountGetResults |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-DatabaseName
Databasenaam voor de MongoDB-roldefinitie.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-DefaultProfile
De referenties, accounts, tenants en abonnementen die worden gebruikt voor communicatie met Azure.
Type: | IAzureContextContainer |
Aliassen: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Id
Unieke id van roldefinitie(indeling is <databaseName>.<roleName>
).
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Mechanisms
Wachtwoord voor de gebruikersdefinitie.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Password
Wachtwoord voor de gebruikersdefinitie.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-ResourceGroupName
Naam van resourcegroep.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-ResourceId
ResourceId van de resource.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Roles
Set overgenomen rollen voor CosmosDB MongoDB API-roldefinitie.
Type: | List<T>[PSMongoRole] |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-UserName
Unieke gebruikersnaam(per database) voor de gebruikersdefinitie.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-WhatIf
Toont wat er zou gebeuren als de cmdlet wordt uitgevoerd. De cmdlet wordt niet uitgevoerd.
Type: | SwitchParameter |
Aliassen: | wi |
Position: | Named |
Default value: | False |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
Uitvoerwaarden
Microsoft.Azure.Commands.CosmosDB.Models.PSMongoDBRoleDefinitionGetResults
Verwante koppelingen
Azure PowerShell