New-AzureBatchComputeNodeUser

Creates a user account on a Batch compute node.

Syntax

New-AzureBatchComputeNodeUser
   [-PoolId] <String>
   [-ComputeNodeId] <String>
   -Name <String>
   -Password <SecureString>
   [-ExpiryTime <DateTime>]
   [-IsAdmin]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
New-AzureBatchComputeNodeUser
   [[-ComputeNode] <PSComputeNode>]
   -Name <String>
   -Password <SecureString>
   [-ExpiryTime <DateTime>]
   [-IsAdmin]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzureBatchComputeNodeUser cmdlet creates a user account on an Azure Batch compute node.

Examples

Example 1: Create a user account that has administrative credentials

PS C:\>New-AzureBatchComputeNodeUser -PoolId "MyPool01" -ComputeNodeId "ComputeNode01" -Name "TestUser" -Password "Password" -ExpiryTime ([DateTime]::Now.AddDays(7)) -IsAdmin -BatchContext $Context

This command creates a user account on the compute node that has the ID ComputeNode01. The node is in the pool that has the ID MyPool01. The user name is TestUser, the password is Password, the account expires in seven days, and the account is has administrative credentials.

Example 2: Create a user account on a compute node by using the pipeline

PS C:\>Get-AzureBatchComputeNode "MyPool01" -ComputeNodeId "ComputeNode01" -BatchContext $Context | New-AzureBatchComputeNodeUser -Name "TestUser" -Password "Password" -BatchContext $Context

This command gets the compute node named ComputeNode01 by using the Get-AzureBatchComputeNode cmdlet. That node is in the pool that has the ID MyPool01. The command passes that compute node to the current cmdlet by using the pipeline operator. The command creates a user account that has the user name TestUserand the password Password.

Required Parameters

-BatchContext

Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. If you use the Get-AzureRmBatchAccount cmdlet to get your BatchAccountContext, then Azure Active Directory authentication will be used when interacting with the Batch service. To use shared key authentication instead, use the Get-AzureRmBatchAccountKeys cmdlet to get a BatchAccountContext object with its access keys populated. When using shared key authentication, the primary access key is used by default. To change the key to use, set the BatchAccountContext.KeyInUse property.

Type:Microsoft.Azure.Commands.Batch.BatchAccountContext
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ComputeNodeId

Specifies the ID of the compute node on which this cmdlet creates a user account.

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of the new local Windows account.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Password

Specifies the user account password.

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PoolId

Specifies the ID of the pool that contains the compute node on which to create the user account.

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-ComputeNode

Specifies the compute node, as a PSComputeNode object, on which this cmdlet creates a user account.

Type:Microsoft.Azure.Commands.Batch.Models.PSComputeNode
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ExpiryTime

Specifies the expiry time for the new user account.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IsAdmin

Indicates that the cmdlet creates a user account that has administrative credentials.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

BatchAccountContext

Parameter 'BatchContext' accepts value of type 'BatchAccountContext' from the pipeline

Inputs

PSComputeNode

Parameter 'ComputeNode' accepts value of type 'PSComputeNode' from the pipeline