## PowerCLI Reference

# Set-VMGuestNetworkInterface

## Synopsis

This cmdlet configures the network settings of a virtual machine using VMware Tools.

Syntax

Set-VMGuestNetworkInterface -VmGuestNetworkInterface <VMGuestNetworkInterface[]> [-WinsPolicy <DhcpPolicy>] [-Wins <String[]>] [-DnsPolicy <DhcpPolicy>] [-Dns <String[]>] [-IPPolicy <DhcpPolicy>] [[-Gateway] <Object>] [[-Netmask] <String>] [[-Ip] <IPAddress>] [-ToolsWaitSecs <Int32>] [-GuestPassword <SecureString>] [-GuestUser <String>] [-GuestCredential <PSCredential>] [-HostPassword <SecureString>] [-HostUser <String>] [-HostCredential <PSCredential>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-VMGuestNetworkInterface

Detailed Description

This cmdlet is deprecated. Use Invoke-VMScript instead.
This cmdlet configures the network settings of a virtual machine using VMware Tools. The cmdlet allows IP and routing configuration. You can modify Wins settings only for Windows virtual machines. The cmdlet sends a remote script which executes inside the virtual machine in the context of the specified user account. For a list of supported operating systems, see the PowerCLI User's Guide.
To run this cmdlet against vCenter Server/ESX/ESXi versions earlier than 5.0, you need to meet the following requirements:
*You must run the cmdlet on the 32-bit version of Windows PowerShell.
*You must have access to the ESX that hosts the virtual machine over TCP port 902.
*For vCenter Server/ESX/ESXi versions earlier than 4.1, you need VirtualMachine.Interact.ConsoleInteract privilege. For vCenter Server/ESX/ESXi 4.1 and later, you need VirtualMachine.Interact.GuestControl privilege.
To run this cmdlet against vCenter Server/ESXi 5.0 and later, you need VirtualMachine.GuestOperations.Execute and VirtualMachine.GuestOperations.Modify privileges.

Parameters

Name | Type | Description | Required? | Pipeline Input | Default Value
--- | --- | --- | --- | --- | ---
Ip | IPAddress | Specifies an IP address. Use this parameter only if The IpPolicy parameter is set to Static. | false | false
Netmask | String | Specifies a network mask. | false | false
Gateway | Object | Specifies a gateway. | 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
Dns | String[] | Specifies DNS addresses. Use this parameter only if The DnsPolicy parameter is set to Static. | false | false
DnsPolicy | DhcpPolicy | Specifies the DNS policy. The valid values are Static and Dhcp. | false | false
GuestCredential | PSCredential | Specifies a PSCredential object that contains credentials for authenticating with the guest OS. Do not use this parameter if the GuestUser and GuestPassword parameters are used. | false | false
GuestPassword | SecureString | Specifies the password you want to use for authenticating with the guest OS. | false | false
GuestUser | String | Specifies the user name you want to use for authenticating with the guest OS. | false | false
HostCredential | PSCredential | Specifies a PSCredential object that contains credentials for authenticating with the host. Do not use this parameter if the HostUser and HostPassword parameters are used. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. | false | false
HostPassword | SecureString | Specifies the password you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. | false | false
HostUser | String | Specifies the user name you want to use for authenticating with the host. You need to specify host credentials only if the version of the vCenter Server or ESX you are authenticating with is earlier than 4.0, or the VIX version you have installed is earlier than 1.10. | false | false
IPPolicy | DhcpPolicy | Specifies the IP policy. The valid values are Static and Dhcp. | false | false
ToolsWaitSecs | Int32 | Specifies the time in seconds to wait for a response from VMware Tools. If a non-positive value is provided, the system waits indefinitely. | false | false
VmGuestNetworkInterface | VMGuestNetworkInterface[] | Specifies the guest network interface you want to configure. | 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
Wins | String[] | Specifies WINS servers. Use this parameter only if the WinsPolicy parameter is set to Static. | false | false
WinsPolicy | DhcpPolicy | Specifies the Wins policy. The valid values are Static and Dhcp. | false | false

Return Type

Zero or more modified VMGuestNetworkInterface objects

Notes

This cmdlet is not compatible with IPv6 environments.

Examples

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

    Set-VMGuestNetworkInterface -VMGuestNetworkInterface $vmGuestNetworkInterface -GuestUser User -GuestPassword Pass02 -Netmask 255.255.255.255 -Gateway 10.23.112.58

Changes the net mask and the gateway of the specified guest network interface.

Copyright © VMware, Inc. All rights reserved.