sync
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
$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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user