使用Windows PowerShell管理虛擬交換器

來源:互聯網
上載者:User

標籤:hyper-v、windows powershell、虛擬交換器

前面介紹了Hyper-V 2012 R2的虛擬交換器,但是企業常常部署的是Windows Server 2012 R2 Server Core模式或者使用免費的Hyper-V Server 2012 R2,這時就需要管理員使用Windows PowerShell管理Hyper-V虛擬交換器。本篇幅示範使用Windows PowerShell管理Hyper-V虛擬交換器。

“BJ-VMHost-06”是一台安裝Hyper-V Server 2012 R2的伺服器。通過遠程調用PowerShell管理“BJ-VMHost-07”上的虛擬交換器。

微軟在PowerShell下通過使用Get-Help協助管理員瞭解強大的Windows PowerShell。以管理員身份運行PowerShell ISE,點擊檔案,選擇“建立遠程PowerShell選項卡”

650) this.width=650;" height="250" title="clip_image002" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image002" src="http://s3.51cto.com/wyfs02/M00/58/CC/wKioL1S9Cd7C6HVfAADC9nuzqGY999.jpg" border="0" />

建立遠程PowerShell選項卡對話方塊中鍵入伺服器名稱以及有效賬戶資訊

650) this.width=650;" height="180" title="clip_image003" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image003" src="http://s3.51cto.com/wyfs02/M00/58/CF/wKiom1S9CQugHQStAACtR8wzJvQ704.jpg" border="0" />

使用“Get-Help *VMSwitch”查詢和Hyper-V相關的虛擬交換器命令資訊。

650) this.width=650;" height="188" title="clip_image005" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image005" src="http://s3.51cto.com/wyfs02/M02/58/CF/wKiom1S9CQujXWmdAAD0sfefMNg233.jpg" border="0" />

使用“Get-NetAdapter”顯示所有可用的網路介面卡

650) this.width=650;" height="122" title="clip_image007" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image007" src="http://s3.51cto.com/wyfs02/M00/58/CC/wKioL1S9Cd6RLILrAACxNEb0U8M068.jpg" border="0" />

使用“Get-VMSwitch”命令顯示當前已建立的所有虛擬交換器

650) this.width=650;" height="126" title="clip_image009" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image009" src="http://s3.51cto.com/wyfs02/M01/58/CF/wKiom1S9CQyj2EpYAACPJUBX3Rc246.jpg" border="0" />

使用“Get-VMSwitch -SwitchType”命令查看指定類型的虛擬交換器

650) this.width=650;" height="94" title="clip_image011" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image011" src="http://s3.51cto.com/wyfs02/M02/58/CF/wKiom1S9CQzCgaIcAABvbcEo9xM406.jpg" border="0" />

使用“New--VMSwitch”命令建立Hyper-V虛擬交換器,並再次使用使用“Get-VMSwitch”命令查看已建立的虛擬交換器

650) this.width=650;" height="174" title="clip_image013" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image013" src="http://s3.51cto.com/wyfs02/M00/58/CC/wKioL1S9CeDSV0hGAADM2ZlwyPA653.jpg" border="0" />

在“BJ-VMHost-07”上使用Hyper-V管理器串連到“BJ-VMHost-06”查看建立的虛擬交換器以及建立的虛擬交換器,右鍵“BJ-VMHost-06”選擇虛擬交換器管理器

650) this.width=650;" height="265" title="clip_image015" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image015" src="http://s3.51cto.com/wyfs02/M02/58/CC/wKioL1S9CeDRaI2zAADUpyJfKCI343.jpg" border="0" />

虛擬交換器管理器頁面,能看見四個虛擬交換器,包括建立的“LAB2”

650) this.width=650;" height="231" title="clip_image017" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image017" src="http://s3.51cto.com/wyfs02/M00/58/CF/wKiom1S9CQ6Rq5BEAADseKxKbrw656.jpg" border="0" />

使用同上的命令建立私人虛擬交換器和內部虛擬交換器

650) this.width=650;" height="158" title="clip_image019" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image019" src="http://s3.51cto.com/wyfs02/M01/58/CC/wKioL1S9CeLANs-qAACwpijBrwM552.jpg" border="0" />

650) this.width=650;" height="308" title="clip_image021" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image021" src="http://s3.51cto.com/wyfs02/M01/58/CC/wKioL1S9CeODFNHuAAELzHz77ro057.jpg" border="0" />

使用“Remove-VMSwitch”命令刪除Hyper-V虛擬交換器

650) this.width=650;" height="192" title="clip_image023" style="margin:0px;border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image023" src="http://s3.51cto.com/wyfs02/M02/58/CC/wKioL1S9CeTwapDwAADj9pv93gM415.jpg" border="0" />

使用“Rename-VMSwitch”命令重命令已建立的虛擬交換器

650) this.width=650;" height="135" title="clip_image025" style="border:0px;padding-top:0px;padding-right:0px;padding-left:0px;background-image:none;" alt="clip_image025" src="http://s3.51cto.com/wyfs02/M01/58/CF/wKiom1S9CRHCCJX7AACi-uvh8Mc575.jpg" border="0" />

關於更多關於Hyper-V的PowerShell可以參閱微軟TechNet

http://technet.microsoft.com/en-us/library/hh848559.aspx

本文出自 “徐庭的部落格-微軟技術分享” 部落格,請務必保留此出處http://ericxuting.blog.51cto.com/8995534/1605929

使用Windows PowerShell管理虛擬交換器

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.