New-​Azure​Batch​Compute​Node​User

Creates a user account on a Batch compute node.

Syntax

New-AzureBatchComputeNodeUser
   [[-ComputeNode] <PSComputeNode>]
   -BatchContext <BatchAccountContext>
   [-ExpiryTime <DateTime>]
   [-IsAdmin]
   -Name <String>
   -Password <String>
   [<CommonParameters>]
New-AzureBatchComputeNodeUser
   [-PoolId] <String>
   [-ComputeNodeId] <String>
   -BatchContext <BatchAccountContext>
   [-ExpiryTime <DateTime>]
   [-IsAdmin]
   -Name <String>
   -Password <String>
   [<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. To obtain a BatchAccountContext object that contains access keys for your subscription, use the Get-AzureRmBatchAccountKeys cmdlet.

Type: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:String
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:PSComputeNode
Position:0
Default value:None
Accept pipeline input:True (ByValue)
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:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False