powercli set-vmhostnetwork
# DNS Servers
$dnspri = "192.168.161.203"
$dnsalt = "192.168.161.213"
# Domain Name
$domainname = "test.org"
# NTP Servers
$ntpone = "192.168.168.253"
#Default Gateway
$dg = "192.168.165.254"
$esxHosts = get-VMHost
#esxHost = import-csv c:\test.csv
foreach ($esx in $esxHosts) {
Write-Host "add physical network adapter to vswitch" -ForegroundColor Green
$myVMHostNetworkAdapter = Get-VMhost $esx | Get-VMHostNetworkAdapter -Physical -Name vmnic0,vmnic1
Get-VirtualSwitch -VMHost 192.168.1.11 -Name "vSwitch0" | Add-VirtualSwitchPhysicalNetworkAdapter -VMHostPhysicalNic $myVMHostNetworkAdapter
Write-Host "Configuring DNS and Domain Name on $esx" -ForegroundColor Green
Get-VMHostNetwork -VMHost $esx | Set-VMHostNetwork -DomainName $domainname -DNSAddress $dnspri , $dnsalt -Confirm:$false
Write-Host "Configuring Default Gateway IP on $esx" -ForegroundColor Green
Get-VMHostNetwork -VMHost $esx | Set-VMHostNetwork -ConsoleGateway $dg
Write-Host "Configuring hostname on $esx" -ForegroundColor Green
Get-VMHostNetwork -VMHost $esx | Set-VMHostNetwork -HostName $esx.Name
Write-Host "Configuring NTP Servers on $esx" -ForegroundColor Green
Add-VMHostNTPServer -NtpServer $ntpone -VMHost $esx -Confirm:$false
Write-Host "Configuring NTP Client Policy on $esx" -ForegroundColor Green
Get-VMHostService -VMHost $esx | where{$_.Key -eq "ntpd"} | Set-VMHostService -policy "on" -Confirm:$false
Write-Host "Restarting NTP Client on $esx" -ForegroundColor Green
Get-VMHostService -VMHost $esx | where{$_.Key -eq "ntpd"} | Restart-VMHostService -Confirm:$false
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Kotlin 基礎 Part 4 -- List と Set の違いと相互変換set というものが有るのを知った List 系の頂点に立つもの. List や Set はこれを継承して作られるらしい. 抽象クラスのような直接は使えないものとして解釈する. 普通の配列. 0 에서 n-1 の順番にはいっている. lis...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.