New-VMHostAccount

This cmdlet creates a new host user or group account using the provided parameters.

Syntax

-Id  <String>
[-AssignUsers  <String[]>]
[-GroupAccount]
[-Server  <VIServer[]>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Id
String named Specifies an ID for the new host account.
optional
AssignUsers
String[] named If the GroupAccount parameter is set to $true, use AssignUsers to specify the users that belong to the newly created group account.
optional
GroupAccount
SwitchParameter named Indicates that the new host account is a group account. Starting with ESXi 5.1, this parameter is not supported.
optional
Server
VIServer[] named
  • wildcards
  • pipeline
  • Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release.

    [-Password]  <String>
    -Id  <String>
    [-AssignGroups  <String[]>]
    [-Description  <String>]
    [-GrantShellAccess]
    [-Server  <VIServer[]>]
    [-UserAccount]
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    Password
    String 1 Specifies a password for the new host account.
    required
    Id
    String named Specifies an ID for the new host account.
    optional
    AssignGroups
    String[] named If the UserAccount parameter is set to $true, use AssignGroups to specify the groups to which the newly created user belongs.
    optional
    Description
    String named Provide a description of the new host account. The maximum length of the text is 255 symbols.
    optional
    GrantShellAccess
    SwitchParameter named Indicates that the new account is allowed to access the ESX shell.
    optional
    Server
    VIServer[] named
  • wildcards
  • pipeline
  • Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release.
    optional
    UserAccount
    SwitchParameter named Indicates that the new host account is a user account.

    Output

    VMware.VimAutomation.ViCore.Types.V1.Host.Account.HostAccount

    Examples


    Example 1

    New-VMHostAccount -ID MyUser1 -Password MyPassword1 -UserAccount

    Creates a user account with a specified user ID and password. The user account is created on the default server.

    Example 2

    $myUser1 = Get-VMHostAccount -ID MyUser1 -User
    New-VMHostAccount -Id MyGroup1 -GroupAccount -AssignUsers $myUser1

    Creates a group account with a specified ID and assigns a specified user to the group account. Starting with ESXi 5.1, you cannot create group host accounts.

    Related Commands

    Feedback

    Was this page helpful?