VMHost Category | Vmware PowerCLI Reference

VM Host Category

Cmdlets are usually implemented around resource operations. The four basic operations are CREATE, READ, UPDATE and DELETE. This set of operations is known as CRUD. Most of the cmdlets support CRUD which are respectively cmdlets that start with the New/Get/Set/Remove cmdlet verbs but they also may have additional operations

Step 1: Retrieve a object by running a Get command

You can READ objects by using Get-VMHostAttributes cmdlet. See example below:

# Retrieves the identifying attributes for the host named myhost.

C:\PS&#62 Get-VMHostAttributes myhost "ipv4" "192.168.1.1" "vendor" "VMware"

Step 2 : Run commands from the CRUD group

You can CREATE objects by using New-VMHostAccount cmdlet. See example below:

# Creates a user account with a specified user ID and password. The user account is created on the default server.

New-VMHostAccount -ID MyUser1 -Password MyPassword1 -UserAccount
You can UPDATE objects by using Add-VMHost cmdlet. See example below:

# Adds a VM host to a specified vCenter Server system and provides a username and password for authentication.

$myServer = Connect-VIServer -Server 10.23.112.235 Add-VMHost -Server $myServer -Name MyVMHost1 -Location MyDatacenter1 -User MyUsername1 -Password MyPassword1
You can REMOVE objects by using Remove-VMHost cmdlet. See example below:

# Removes all VM hosts in the specified location from the vCenter Server system without asking for confirmation.

$myServer = Connect-VIServer -Server 10.23.112.235 Get-VMHost -Server $myServer -Location MyDatacenter1 | Remove-VMHost -Confirm:$false

Step 3: Explore More Related Commands:


Get-VMHostImageProfile Gets the image profile associated with the specified ESXi host.
Get-VMHostMatchingRules Retrieves the list of rules in the rule set that match a specified host.
Add-VMHostNtpServer This cmdlet adds the specified NTP servers to the NTP server list of the specified hosts.
Export-VMHostProfile This cmdlet exports the specified host profile to a file.
Format-VMHostDiskPartition This cmdlet formats a new VMFS (Virtual Machine File System) on each of the specified host disk partitions.
Get-VMHost This cmdlet retrieves the hosts on a vCenter Server system.
Get-VMHostAccount This cmdlet retrieves the host accounts available on a vCenter Server system.
Get-VMHostAdvancedConfiguration This cmdlet retrieves the advanced configuration of the hosts.
Get-VMHostAuthentication This cmdlet retrieves authentication information for the specified hosts.
Get-VMHostAvailableTimeZone This cmdlet retrieves the time zones available on the specified host.
Get-VMHostDiagnosticPartition This cmdlet retrieves a list of the diagnostic partitions on the specified hosts.
Get-VMHostDisk This cmdlet retrieves information about the specified SCSI LUN disk.
Get-VMHostDiskPartition This cmdlet retrieves the partitions of a host disk (LUN).
Get-VMHostFirewallDefaultPolicy This cmdlet retrieves the firewall default policy of the specified hosts.
Get-VMHostFirewallException This cmdlet retrieves the exceptions from the firewall policy on the specified hosts.
Get-VMHostFirmware This cmdlet retrieves hosts firmware information.
Get-VMHostHardware This cmdlet retrieves ESXi host hardware and firmware information.
Get-VMHostHba This cmdlet retrieves information about the available HBAs (Host Bus Adapter).
Get-VMHostModule This cmdlet retrieves the option strings of the specified host modules.
Get-VMHostNetwork THis cmdlet retrieves the host networks on a vCenter Server system.
Get-VMHostNetworkAdapter This cmdlet retrieves the host network adapters on a vCenter Server system.
Get-VMHostNetworkStack This cmdlet retrieves the host network stacks on a vCenter Server system.
Get-VMHostNtpServer This cmdlet retrieves the NTP servers on the specified hosts.
Get-VMHostPatch This cmdlet retrieves information about the host patches installed on the specified hosts. This cmdlet is deprecated and will not return any results for ESX hosts version 5.0 and later. Use (Get-ESXCli).software.vib.list() as an alternative.
Get-VMHostPciDevice This cmdlet retrieves the PCI devices on the specified hosts.
Get-VMHostProfile This cmdlet retrieves the available host profiles.
Get-VMHostProfileImageCacheConfiguration Retrieves an image cache configuration for the given host profile.
Get-VMHostProfileRequiredInput This cmdlet performs a check whether the available information is sufficient to apply a host profile.
Get-VMHostProfileStorageDeviceConfiguration Retrieves the storage device configuration for the given host profile.
Get-VMHostProfileUserConfiguration This cmdlet retrieves the user password configuration for the given host profile.
Get-VMHostProfileVmPortGroupConfiguration Retrieves the virtual machine port group configuration for the given host profile.
Get-VMHostRoute This cmdlet retrieves the routes from the routing table of the specified hosts.
Get-VMHostService This cmdlet retrieves information about a host service.
Get-VMHostSnmp This cmdlet retrieves hosts SNMP configuration.
Get-VMHostStartPolicy This cmdlet retrieves the start policy of hosts.
Get-VMHostStorage This cmdlet retrieves the host storages on a vCenter Server system.
Get-VMHostSysLogServer This cmdlet displays the remote syslog servers of the specified hosts.
Import-VMHostProfile This cmdlet imports a host profile from a file. The file path must be accessible from the VMware PowerCLI client side.
Install-VMHostPatch This cmdlet updates the specified hosts.
Invoke-VMHostProfile This cmdlet applies a host profile to the specified host or cluster.
Move-VMHost This cmdlet moves hosts to another location.
New-VMHostNetworkAdapter This cmdlet creates a new HostVirtualNIC (Service Console or VMKernel) on the specified host.
New-VMHostProfile This cmdlet creates a new host profile based on a reference host.
New-VMHostProfileVmPortGroupConfiguration This cmdlet creates a new virtual machine port group configuration.
New-VMHostRoute This cmdlet creates a new route in the routing table of a host.
Remove-VMHostAccount This cmdlet removes the specified host accounts.
Remove-VMHostNetworkAdapter This cmdlet removes the specified host network adapters.
Remove-VMHostNtpServer This cmdlet removes the specified NTP servers from the NTP server list of the specified hosts.
Remove-VMHostProfile This cmdlet removes the specified host profiles.
Remove-VMHostProfileVmPortGroupConfiguration Removes the given virtual machine port group configuration from the host profile.
Remove-VMHostRoute This cmdlet removes host routes.
Restart-VMHost This cmdlet restarts the specified hosts.
Restart-VMHostService This cmdlet restarts the specified host services.
Set-VMHost This cmdlet modifies the configuration of the host.
Set-VMHostAccount This cmdlet configures a host account.
Set-VMHostAdvancedConfiguration This cmdlet modifies the advanced configuration settings of a host.
Set-VMHostAuthentication This cmdlet modifies the host authentication information.
Set-VMHostDiagnosticPartition This cmdlet activates or deactivates the diagnostic partitions of hosts.
Set-VMHostFirewallDefaultPolicy This cmdlet sets the default policy for the specified host firewall.
Set-VMHostFirewallException This cmdlet activates or deactivates host firewall exceptions.
Set-VMHostFirmware This cmdlet configures hosts firmware settings.
Set-VMHostHba This cmdlet configures the CHAP properties of the specified iSCSI HBAs.
Set-VMHostModule This cmdlet overrides the host module options with the given ones.
Set-VMHostNetwork This cmdlet updates the specified virtual network.
Set-VMHostNetworkAdapter This cmdlet configures the specified host network adapter.
Set-VMHostNetworkStack This cmdlet modifies the specified host network stack.
Set-VMHostProfile This cmdlet modifies the specified host profile.
Set-VMHostProfileImageCacheConfiguration This cmdlet modifies image cache configuration for given host profile.
Set-VMHostProfileStorageDeviceConfiguration This cmdlet modifies the storage device configuration for the given host profile.
Set-VMHostProfileUserConfiguration This cmdlet modifies the user password configuration for the specified account within a host profile.
Set-VMHostProfileVmPortGroupConfiguration This cmdlet modifies the virtual machine port group configuration for the given host profile.
Set-VMHostRoute This cmdlet modifies a route in the host routing table.
Set-VMHostService This cmdlet modifies a host service.
Set-VMHostSnmp This cmdlet modifies the host SNMP configuration.
Set-VMHostStartPolicy This cmdlet modifies the host default start policy.
Set-VMHostStorage This cmdlet configures a host storage.
Set-VMHostSysLogServer This cmdlet configures the remote syslog server of the specified hosts.
Start-VMHost This cmdlet starts the specified hosts.
Start-VMHostService This cmdlet starts the specified host services.
Stop-VMHost This cmdlet powers off the specified hosts.
Stop-VMHostService This cmdlet stops the specified host services.
Suspend-VMHost This cmdlet suspends hosts.
Test-VMHostProfileCompliance This cmdlet tests hosts for profile compliance.
Test-VMHostSnmp This cmdlet tests the host SNMP.
Export-VMHostImageDb This cmdlet exports the specified host's base image database to a file that is in a .tgz format.
Get-VMHostTPM This cmdlet retrieves the TPM 2.0 devices from the specified host.