< Back
Set-VMHostAccount
Post
NAME Set-VMHostAccount
SYNOPSIS
This cmdlet configures a host account.
SYNTAX
Set-VMHostAccount [-UserAccount] <HostUserAccount[]> [-AssignGroups <String[]>] [-Description <String>]
[-GrantShellAccess <Boolean>] [-Password <String>] [-Server <VIServer[]>] [-UnassignGroups <String[]>] [-Confirm]
[-WhatIf] [<CommonParameters>]
Set-VMHostAccount [-GroupAccount] <HostGroupAccount[]> [-AssignUsers <String[]>] [-Server <VIServer[]>]
[-UnassignUsers <String[]>] [-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
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.
PARAMETERS
-AssignGroups <String[]>
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.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-AssignUsers <String[]>
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.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Description <String>
Provides a description of the specified account. The maximum length of the text is 255 symbols.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-GrantShellAccess <Boolean>
Indicates that the account is allowed to access the ESX shell.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-GroupAccount <HostGroupAccount[]>
Specifies the host group account you want to configure. Starting with ESXi 5.1, you cannot configure group
host accounts.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-Password <String>
Specifies a new password for the account.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Server <VIServer[]>
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this
parameter, the command runs on the default servers. For more information about default servers, see the
description of Connect-VIServer.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? true
-UnassignGroups <String[]>
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.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-UnassignUsers <String[]>
If a group host account is to be configured, specifies the users you want to remove from the account.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-UserAccount <HostUserAccount[]>
Specifies the host user account you want to configure.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,
the cmdlet runs without asking for user confirmation.
Required? false
Position? named
Default value $true
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are
modified.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Zero or more modified HostUserAccount or HostGroupAccount objects
NOTES
If both of the AssignUsers (AssignGroup) and UnassignUsers (UnassignGroup) parameters are specified, the
Assign* parameter is applied first. If the same user and group are specified for Assign and Unassign , a
terminating error is thrown. Starting with ESXi 5.1, you cannot configure group host accounts.
-------------------------- 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 LINKS
Online Version: https://code.vmware.com/doc/preview?id= ... count.html
New-VMHostAccount
Get-VIAccount
Remove-VMHostAccount
SYNOPSIS
This cmdlet configures a host account.
SYNTAX
Set-VMHostAccount [-UserAccount] <HostUserAccount[]> [-AssignGroups <String[]>] [-Description <String>]
[-GrantShellAccess <Boolean>] [-Password <String>] [-Server <VIServer[]>] [-UnassignGroups <String[]>] [-Confirm]
[-WhatIf] [<CommonParameters>]
Set-VMHostAccount [-GroupAccount] <HostGroupAccount[]> [-AssignUsers <String[]>] [-Server <VIServer[]>]
[-UnassignUsers <String[]>] [-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
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.
PARAMETERS
-AssignGroups <String[]>
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.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-AssignUsers <String[]>
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.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Description <String>
Provides a description of the specified account. The maximum length of the text is 255 symbols.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-GrantShellAccess <Boolean>
Indicates that the account is allowed to access the ESX shell.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-GroupAccount <HostGroupAccount[]>
Specifies the host group account you want to configure. Starting with ESXi 5.1, you cannot configure group
host accounts.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-Password <String>
Specifies a new password for the account.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Server <VIServer[]>
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this
parameter, the command runs on the default servers. For more information about default servers, see the
description of Connect-VIServer.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? true
-UnassignGroups <String[]>
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.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-UnassignUsers <String[]>
If a group host account is to be configured, specifies the users you want to remove from the account.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-UserAccount <HostUserAccount[]>
Specifies the host user account you want to configure.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,
the cmdlet runs without asking for user confirmation.
Required? false
Position? named
Default value $true
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are
modified.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Zero or more modified HostUserAccount or HostGroupAccount objects
NOTES
If both of the AssignUsers (AssignGroup) and UnassignUsers (UnassignGroup) parameters are specified, the
Assign* parameter is applied first. If the same user and group are specified for Assign and Unassign , a
terminating error is thrown. Starting with ESXi 5.1, you cannot configure group host accounts.
-------------------------- 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 LINKS
Online Version: https://code.vmware.com/doc/preview?id= ... count.html
New-VMHostAccount
Get-VIAccount
Remove-VMHostAccount