## PowerCLI Reference

# Set-VMHostAuthentication

## Synopsis

This cmdlet modifies the host authentication information.

Syntax

Set-VMHostAuthentication [-Domain] <String> [[-Username] <String>] [[-Password] <SecureString>] [-Credential <PSCredential>] -JoinDomain -VMHostAuthentication <VMHostAuthentication[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Set-VMHostAuthentication [-Force] -LeaveDomain -VMHostAuthentication <VMHostAuthentication[]> [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-VMHostAuthentication

Detailed Description

This cmdlet modifies the host authentication information.

Parameters

Name | Type | Description | Required? | Pipeline Input | Default Value
--- | --- | --- | --- | --- | ---
Domain | String | Specifies a domain you want to join. | true | false
Username | String | Specifies a user name for authentication. | false | false
Password | SecureString | Specifies a password for authentication. | false | 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. | false | false
Credential | PSCredential | Specifies a credential object for authentication. | false | false
Force | SwitchParameter | If the value is $true, any existing permissions on the managed objects for Active Directory users are deleted and the cmdlet completes. If the value is $false, the cmdlet cannot run if there are any existing permissions on managed objects for Active Directory users. | false | false
JoinDomain | SwitchParameter | Indicates whether you want to join the specified domain. | true | false
LeaveDomain | SwitchParameter | Indicates whether you want to leave the currently joined domain. | true | false
VMHostAuthentication | VMHostAuthentication[] | Specifies the VMHostAuthentication object you want to modify. | true | true (ByValue)
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | false

Return Type

Zero or more modified VMHostAuthentication objects

Notes

Examples

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

    $vmhost | Get-VMHostAuthentication | Set-VMHostAuthentication -JoinDomain -Domain "DomainName.com" -User "Username1" -Password "Password1"

Include an ESX host in a domain.

-------------- Example 2 --------------

    $vmhost | Get-VMHostAuthentication | Set-VMHostAuthentication -LeaveDomain

Exclude an ESX host from a domain.

-------------- Example 3 --------------

    $vmhost | Get-VMHostAuthentication | Set-VMHostAuthentication -LeaveDomain -Force

Exclude an ESX host from a domain. If AD account permissions are defined on the host, they will be removed.

Copyright © VMware, Inc. All rights reserved.