vSphere PowerCLI Reference

New-VMHostAccount

Synopsis

Creates a new host user or group account.

Syntax

New-VMHostAccount [-Id] <String> [-Password] <String> [-Description <String>] [-UserAccount] [-AssignGroups <String[]>] [-GrantShellAccess] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
New-VMHostAccount [-Id] <String> [-GroupAccount] [-AssignUsers <String[]>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Set-VMHostAccount
Get-VIAccount
Remove-VMHostAccount

Detailed Description

Creates a new host user or group account using the provided parameters.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
IdStringSpecify an ID for the new host account.truefalse
PasswordStringSpecify a password for the new host account.truefalse
AssignGroupsString[]If the UserAccount parameter is set to $true, use AssignGroups to specify the groups to which the newly created user belongs.falsefalse
AssignUsersString[]If the GroupAccount parameter is set to $true, use AssignUsers to specify the users that belong to the newly created group account.falsefalse
ConfirmSwitchParameterIf 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.falsefalse$true
DescriptionStringProvide a description of the new host account. The maximum length of the text is 255 symbols.falsefalse
GrantShellAccessSwitchParameterIndicate that the new account is allowed to access the ESX shell.falsefalse
GroupAccountSwitchParameterIndicate that the new host account is a group account.falsefalse
ServerVIServer[]Specify the vSphere server 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. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release.falsetrue (ByValue)
UserAccountSwitchParameterIndicate that the new host account is a user account.falsefalse
WhatIfSwitchParameterIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

HostUserAccount or HostGroupAccount

Notes

Examples

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

New-VMHostAccount -ID User1 -Password pass -UserAccount   New-VMHostAccount -Id Group1 -GroupAccount -AssignUsers User1

Creates a user account with ID user1 and a group account with ID Group1. Assigns the User1 user account to the Group1 account.


Copyright © 1998 - 2011 VMware, Inc. All rights reserved.