Hyper V server 2012 r2 常用的powershell命令
? 獲取網卡信息 Get-netadapter
Get-netipinterface
? 設置DNS地址Set-DnsClientServerAddress -InterfaceAlias NIC NAME -ServerAddresses "1.1.1.1","2.2.2.2"
註釋:NIC Name: 網卡名稱, 1.1.1.1,2.2.2.2
? 網卡聚合NIC Teaming: New-NetLbfoTeam –name AdminTeam –TeamMembers VM1,VM2,VM3 –TeamingMode SwitchIndependent –LoadBalancingAlgorithm HyperVPort
註釋:AdminTeam: 給聚合的網卡取名, VM1/2/3:被聚合的網卡名稱
? 禁用IPv6New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters -Name DisabledComponents -PropertyType DWord -Value 0xffffffff
? 關閉防火墻netsh advfirewall set allprofiles state off
? 重命名網卡Rename-NetAdapter –name “old name” –NewName “”new_name“”
? 獲取相關IP命令Get-command –module nettcpip
? 查看/安裝角色和特性Get-windowsfeature
Install-windowsfeature
? 查看磁盤信息Get-disk
? 查看服務Get-service
? 查看系統信息Systeminfo
Msinfo32
? 添加SNMP組件Add SNMP - "Add-WindowsFeature -Name SNMP-Service -IncludeAllSubFeature -IncludeManagementTools"
? 查看補丁Get-hotfix
Hyper V server 2012 r2 常用的powershell命令