Hyper V server 2012 R2 commonly used powershell commands
Hyper V server 2012 r2 common powershell commands
·Get network card information
Get-netadapter
Get-netipinterface
·Set DNS address
Set-DnsClientServerAddress -InterfaceAlias NIC NAME -ServerAddresses "1.1.1.1","2.2.2.2"
Note: NIC Name: NIC Name, 1.1.1.1, 2.2.2.2
·NIC aggregation NIC Teaming:
New-NetLbfoTeam -name AdminTeam -TeamMembers VM1,VM2,VM3 -TeamingMode SwitchIndependent -LoadBalancingAlgorithm HyperVPort
Comment: AdminTeam: Name the aggregated NIC, VM1/2/3: Name the aggregated NIC
·Disable IPv6
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters -Name DisabledComponents -PropertyType DWord -Value 0xffffffff
·Turn off the firewall
netsh advfirewall set allprofiles state off
·Renaming network cards
Rename-NetAdapter -name "old name" -NewName ""new_name""
·Obtain relevant IP commands
Get-command -module nettcpip
·View/install characters and features
Get-windowsfeature
Install-windowsfeature
·View disk information
Get-disk
·View Services
Get-service
·View system information
Systeminfo
Msinfo32
·Add SNMP components
Add SNMP - "Add-WindowsFeature -Name SNMP-Service -IncludeAllSubFeature -IncludeManagementTools"
·View patches
Get-hotfix