Connect-VIServer -Server 10.1.133.117 -User root -Password <password> (Host, on this occasion)
Get-VMHost
Get-Command -PSSnapin VMware.VimAutomation.Core
Get-VMHostNetworkAdapter
Get-VMHostNetwork
Get-VM
Get-PowerCLIVersion
Get-VMHostDisk
Get-VIPermission
Get-VIEvent
Get-VIPrivilege
Get-VIRole
Get-VMHostHba
Get-VMHostModule
Get-VMHostNetwork
Get-HostNetworkAdapter
Get-VMHostNtpServer
(Get-ESXCLI).software.vib.list()
Get-VMHostPciDevice
Get-VMStartPolicy
Get-PowerCLIVersion
Get-VMHostDisk
Get-VIPermission
Get-VIEvent
Get-VIPrivilege
Get-VIRole
Get-VMHostHba
Get-VMHostModule
Get-VMHostNetwork
Get-HostNetworkAdapter
Get-VMHostNtpServer
(Get-ESXCLI).software.vib.list()
Get-VMHostPciDevice
Get-VMStartPolicy
Connect-VIServer -Server 10.1.135.120 -User administrator@vsphere.local -Password <password> (vCenter, on this occasion)
Disconnect-VIServer -Server 10.1.135.120 -Force
Get-DataCenter
Disconnect-VIServer -Server 10.1.135.120 -Force
Get-DataCenter
Get-VirtualSwitch -VMHost 10.1.133.117
Get-VMHost | Get-VMHostNetwork | Select Hostname, VMkernelGateway -ExpandProperty VirtualNIC
Get-VMHost | Get-VMHostNetwork | Select Hostname, VMkernelGateway -ExpandProperty PhysicalNIC
Get-VMHost | Get-VMHostNetwork | Select Hostname, VMkernelGateway -ExpandProperty PhysicalNIC
Get-VMHost | Get-VMHostNetwork | Select Hostname, VMkernelGateway -ExpandProperty VirtualNic | where {$_.VMotionEnabled} | Select Hostname, PortGroupName, IP, SubnetMask, VMkernelGateway, Devicename
Get-VMHost
Get-Cluster
Get-Cluster Marketing | Get-VM | Get-NetworkAdapter | ft Parent, MacAddress -auto
Get-VirtualPortGroup
Get-VMHost -Name 10.1.133.117 | Get-VM | Get-NetworkAdapter | ft Parent, MacAddress -auto
Get-Cluster Marketing | Get-VM
Get-Cluster Marketing | Get-VM | where { ($_ | Get-VirtualPortGroup | where {$_.vlanid -match "3105"})} | Select Name, @{N="MacAddress";E={[String]::Join(',',($_.Guest.Nics | %{$_.MacAddress}))}}, @{N="VLanID";E={[String]::Join('#',(Get-VirtualPortGroup %{$_.VLanID}))}}
Get-NicTeamingPolicy vSwitch1
Get-VMHost -Name 10.1.133.117 | Get-VirtualSwitch -Name vSwitch1 | Get-NicTeamingPolicy
Get-VMHost -Name 10.1.133.117 | Get-VirtualPortGroup -Name 'Management Network' | Get-NicTeamingPolicy
Get-VMHostNetworkAdapter -VMHost 10.1.133.117 -Name vmk0
Get-VMHostNetworkAdapter -VMHost 10.1.133.117 -Name vmk1
Get-VMHostNetworkAdapter -VMHost 10.1.133.117 -Name vmnic2 | Get-VMHostNetworkAdapter -BitRatePerSecMb 10000 -Duplex Full -Confirm:$false Works for "true" as well
Get-VMHost -Name 10.1.133.117 | Get-VMHostNetworkAdapter | Select-Object -Property Name,Mac,DhcpEnabled,IP,SubnetMask | Format-Table -AutoSize
The below commands in RED and Italics did not work, need to try again:
$VMHost=Get-VMHost -Name 10.1.133.117
Get-VirtualSwitch -VMHost $VMHost
Get-VirtualSwitch -VMHost $VMHost -Name vSwitch1
$VirtualSwitch=$VMHost | Get-VirtualSwitch -Name vSwitch1
Get-VirtualSwitch -VMHost $VMHost -Name vSwitch1 | Set-VirtualSwitch -Mtu 9000 -Nic vmnic2,vmnic3 -Confirm:$false
New-VMHostNetworkAdapter -VMHost $VMHost -PortGroup OneMorePortGroupForFun -VirtualSwitch $VirtualSwitch -IP 10.1.133.221 -SubnetMask 255.255.255.0
Get-Cluster MyCluster | Set-Cluster -HAAdmissionControlEnabled $true -HAFailoverLevel 1 -Confirm:$false
Get-Cluster | Set-Cluster -HAEnabled:$false -DrsEnabled:$false -Confirm:$false
Get-Cluster | Set-Cluster -HAEnabled:$true -DrsEnabled:$true -Confirm:$false
Get-Cluster Cluster1 | Set-Cluster -DrsAutomationLevel FullyAutomated -HAFailoverLevel 1 -Confirm:$falseGet-Cluster Cluster1 | Set-Cluster -DrsAutomationLevel PartiallyAutomated -HAFailoverLevel 1 -Confirm:$false
Get-Cluster Cluster1 | Set-Cluster -DrsAutomationLevel Manual -HAFailoverLevel 1 -Confirm:$false
Get-Cluster | Set-Cluster -HARestartPriority High
Get-Cluster | Set-Cluster -HARestartPriority Low
Get-Cluster | Set-Cluster -VMSwapfilePolicy InHostDataStore
Get-Cluster | Set-Cluster -VMSwapfilePolicy WithHost
Get-VMHost 10.1.105.34 | Set-VMHost -State Maintenance
Get-Cluster | Set-Cluster -VMSwapfilePolicy WithHost
Get-VMHost 10.1.105.34 | Set-VMHost -State Maintenance
Get-VMHost 10.1.105.34 | Set-VMHost -State Connected
Start-Sleep -s 5
No comments:
Post a Comment