powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Set-VMHostAccount



NAME
Set-VMHostAccount

SYNOPSIS
Configures a host account.

SYNTAX
Set-VMHostAccount [-GroupAccount] [-AssignUsers ] [-UnassignUsers ] [-Serv
er ] [-WhatIf] [-Confirm] []

Set-VMHostAccount [-UserAccount] [-Password ] [-Description ] [-AssignGroups tring[]>] [-UnassignGroups ] [-GrantShellAccess []] [-Server ] [-WhatIf] [-Confirm]
[]


DESCRIPTION
Configures a host account. When configuring a host user account, you can include or exclude the user from the speci
fied groups.
When configuring a host group account, you can include or exclude the specified users from this group.


PARAMETERS
-GroupAccount
Specify the host group account you want to configure.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-AssignUsers
If a group host account is configured, specify the users you want to add to the account.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-UnassignUsers
If a group host account is to be configured, specify the users you want to remove from the account.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-WhatIf
Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modi
fied.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm
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

-UserAccount
Specify the host user account you want to configure.

Required? false
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-Password
Specify a new password for the account.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Description
Provide a description of the specified account. The maximum length of the text is 255 symbols.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-AssignGroups
If a user host account is to be configured, specify the group to which you want to add the account.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-UnassignGroups
If a user host account is to be configured, specify a group from which you want to remove the account.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-GrantShellAccess []
Indicates that the account is allowed to access the ESX shell.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
HostAccount


NOTES


If both parameters AssignUsers (AssignGroup) and UnassignUsers (UnassignGroup) are specified, first the Assign*
parameter is applied. If the same user and group are specified for Assign and Unassign, then a terminating err
or is thrown.

-------------- Example 1 --------------

C:\PS>$userAccount = New-VMHostAccount -ID User1 -Password pass -UserAccount

$groupAccount = New-VMHostAccount -ID Group1 -GroupAccount -AssignUsers User1


Set-VMHostAccount -UserAccount $userAccount -UnassignGroups Group1


Creates a user account with an ID User1. Then creates a group account with an ID Group1 and assign the user account
User1 to the group account Group1. Finally, excludes the User1 account from the Group1 account.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Set-VMHostAccount.html
New-VMHostAccount
Get-VIAccount
Remove-VMHostAccount