# 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 }
powercli set-vmhostnetwork
原创bard_zhang 博主文章分类:PowerShell ©著作权
文章标签 set powercli vmhosetnetwork 文章分类 虚拟化 云计算
-
get jquery 参数写法 jquery $.get
首先,这三个方法都是Ajax方法中一种与服务器交换数据的请求类型。 一、$.get() $.get() 方法使用 HTTP GET 请求从服务器加载数据。$.get(url,[data],[callback]) 说明: url为请求地址, data为请求数据的列表(是可选的,也可以将要传的参数写在url里面), callback为请求成功后的回调函数,该函数
get jquery 参数写法 JQuery ajax JQuery中get()提交 JQuery中post()提交