Set-VMHostAccount

This cmdlet configures a host account. When configuring a host user account, you can include or exclude the user from the specified groups. When configuring a host group account, you can include or exclude the specified users from this group.

Syntax

-GroupAccount  <HostGroupAccount[]>
[-AssignUsers  <String[]>]
[-Server  <VIServer[]>]
[-UnassignUsers  <String[]>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
GroupAccount
HostGroupAccount[] named
  • pipeline
  • Specifies the host group account you want to configure. Starting with ESXi 5.1, you cannot configure group host accounts.
    optional
    AssignUsers
    String[] named If a group host account is configured, specify the users you want to add to the account. Starting with ESXi 5.1, you cannot configure group host accounts.
    optional
    Server
    VIServer[] named
  • wildcards
  • 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.
    optional
    UnassignUsers
    String[] named If a group host account is to be configured, specifies the users you want to remove from the account.

    -UserAccount  <HostUserAccount[]>
    [-AssignGroups  <String[]>]
    [-Description  <String>]
    [-GrantShellAccess  <Boolean>]
    [-Password  <String>]
    [-Server  <VIServer[]>]
    [-UnassignGroups  <String[]>]
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    UserAccount
    HostUserAccount[] named
  • pipeline
  • Specifies the host user account you want to configure.
    optional
    AssignGroups
    String[] named If a user host account is to be configured, specifies the group to which you want to add the account. Starting with ESXi 5.1, you cannot configure group host accounts.
    optional
    Description
    String named Provides a description of the specified account. The maximum length of the text is 255 symbols.
    optional
    GrantShellAccess
    Boolean named Indicates that the account is allowed to access the ESX shell.
    optional
    Password
    String named Specifies a new password for the account.
    optional
    Server
    VIServer[] named
  • wildcards
  • 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.
    optional
    UnassignGroups
    String[] named If a user host account is to be configured, specifies a group from which you want to remove the account. Starting with ESXi 5.1, you cannot configure group host accounts.

    Output

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

    Examples


    Example 1

    $myUserAccount = New-VMHostAccount -ID MyUser1 -Password MyPassword1 -UserAccount
    $myGroupAccount = New-VMHostAccount -ID MyGroup1 -GroupAccount -AssignUsers $myUserAccount
    Set-VMHostAccount -UserAccount $myUserAccount -UnassignGroups $myGroupAccount

    Creates a user account with an ID MyUser1. Then creates a group account with an ID MyGroup1 and assigns the user account MyUser1 to the group account MyGroup1. Finally, excludes the MyUser1 account from the MyGroup1 account. Starting with ESXi 5.1, you cannot configure group host accounts.

    Related Commands

    Feedback

    Was this page helpful?