Files
Sandbox/VMware-BackupUplinksAndVMKernels.ps1
T
Zack Meier 03dba08135 sync
2026-04-15 15:42:41 -05:00

42 lines
1.2 KiB
PowerShell

$ServerList = @"
itdmdnvm-test01.nd.gov
itdmdnvm-test02.nd.gov
itdmdnvm-test03.nd.gov
"@
$ServerList = ConvertTo-Array -MultiLineString $ServerList
$VMHosts = Get-VMHost $ServerList | sort-object Name
$x = ForEach($VMHost in $VMHosts){
$EsxCli = $VMHost | Get-EsxCli -V2
#$StaticRouteBefore =
$EsxCli.network.ip.route.ipv4.list.Invoke()
<#
Gateway : 10.2.168.241
Interface : vmk2
Netmask : 255.255.255.192
Network : 10.2.169.128
Source : MANUAL
#>
#$PhysicalAdapter = $VMHost | Get-VMHostNetworkAdapter | where-object {$_.Name -eq "vmnic6" -and $_.Name -eq "vmnic7"}
#$dvSwitch = Get-VDSwitch -Name dvSwitch-TSTMGMT1-Backup
<#
$PortGroup = Get-VDPortGroup -Name dvPG_3532_10.2.168.240_28
$DNSRecord = Resolve-DnsName -Name ($VMHost.Name.split('.')[0] + 'co.' + $VMHost.Name.split('.')[1] + '.' + $VMHost.Name.split('.')[2])
$VMHost | New-VMHostNetworkAdapter -PortGroup $PortGroup `
-VirtualSwitch $dvSwitch `
-IP $DNSRecord.IPAddress `
-SubnetMask 255.255.255.240 `
-ManagementTrafficEnabled $true
#>
#$params = @{
# network = '10.2.168.128/26'
#}
#$EsxCli.network.ip.route.ipv4.add
}