Hyper V server 2012 r2 常用的powershell命令

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:被聚合的网卡名称


• 禁用IPv6
New-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

扫描二维码关注公众号,回复: 1869436 查看本文章

• 添加SNMP组件
Add SNMP - "Add-WindowsFeature -Name SNMP-Service -IncludeAllSubFeature -IncludeManagementTools"


• 查看补丁
Get-hotfix

猜你喜欢

转载自blog.51cto.com/snowlai/2136172