Windows Server 2012 R2 supports quite a few cmdlets that allow the user to gain quite a bit of information about the networking configuration of the server machine. Here are a few examples with output.
This command: Get-NetAdapterHardwareInfo
gets hardware information about your wireless adapters.
PS C:\Users\Administrator> Get-NetAdapterHardwareInfo Name Segment Bus Device Function Slot NumaNode PcieLinkSpeed PcieLinkWidth Version ---- ------- --- ------ -------- ---- -------- ------------- ------------- ------- Ethernet 0 1 0 0 2.5 GT/s 1 1.1 Wi-Fi 0 2 0 0 2.5 GT/s 1 1.1 |
The Get-NetAdapterAdvancedProperty Wi-Fi
command; as the name implies, gets advanced information about your wireless adapter.
PS C:\Users\Administrator> Get-NetAdapterAdvancedProperty Wi-Fi Name DisplayName DisplayValue RegistryKeyword RegistryValue ---- ----------- ------------ --------------- ------------- Wi-Fi Receive Buffers 256 *ReceiveBuffers {256} Wi-Fi Transmit Buffers -- *TransmitBuf... {--} Wi-Fi 802.11 Bluetooth High Speed Enable ampEnable {1} Wi-Fi Green Tx -- GreenTx {--} Wi-Fi AdHoc 11n Disable htAdhocEnable {0} Wi-Fi Network Address -- NetworkAddress {--} Wi-Fi Roaming Policy -- roamPolicy {--} Wi-Fi Scan Valid Interval 60 scanTimeValid {60} Wi-Fi 802.11b Preamble Long and Short shortPreamble {1} Wi-Fi Dynamic MIMO Power Save Disable smpsDynamic {0} |
Use the Get-NetAdapter
command to list all network adapters installed in a Windows machine. This is only in Powershell 3.0 and up.
PS C:\Users\Administrator> Get-NetAdapter Name InterfaceDescription ifIndex Status MacAddress LinkSpeed ---- -------------------- ------- ------ ---------- --------- Ethernet Broadcom NetLink (TM) Gigabit Ethernet 12 Disconnected 88-AE-1D-6D-09-BC 0 bps Wi-Fi Qualcomm Atheros AR5B97 Wireless Net... 13 Up 4C-0F-6E-5D-E1-25 54 Mbps VMware Network Adapte...8 VMware Virtual Ethernet Adapter for ... 32 Up 00-50-56-C0-00-08 100 Mbps VMware Network Adapte...1 VMware Virtual Ethernet Adapter for ... 31 Up 00-50-56-C0-00-01 100 Mbps My Connection Viscosity Virtual Adapter V9.1 29 Not Present 00-FF-4E-FB-63-10 0 bps |
Here is how to list disks installed in a Windows Server 2012 machine.
PS C:\Users\Administrator> Get-Disk Number Friendly Name OperationalStatus Total Size Partition Style ------ ------------- ----------------- ---------- --------------- 0 WDC WD3200BPVT-22ZEST0 Online 298.09 GB MBR 1 Mass Storage Device USB Device Online 111.79 GB MBR |
The Get-NetIpAddress
command allows filtering via InterfaceIndex, this allows me to easily check the IP address of my wireless interface.
PS C:\Users\Administrator> Get-NetIPAddress -InterfaceIndex 13 IPAddress : fe80::c57:993b:a496:999c%13 InterfaceIndex : 13 InterfaceAlias : Wi-Fi AddressFamily : IPv6 Type : Unicast PrefixLength : 64 PrefixOrigin : WellKnown SuffixOrigin : Link AddressState : Preferred ValidLifetime : Infinite ([TimeSpan]::MaxValue) PreferredLifetime : Infinite ([TimeSpan]::MaxValue) SkipAsSource : False PolicyStore : ActiveStore IPAddress : 10.10.1.4 InterfaceIndex : 13 InterfaceAlias : Wi-Fi AddressFamily : IPv4 Type : Unicast PrefixLength : 24 PrefixOrigin : Dhcp SuffixOrigin : Dhcp AddressState : Preferred ValidLifetime : 23:25:10 PreferredLifetime : 23:25:10 SkipAsSource : False PolicyStore : ActiveStore |
Get information about your network connections with this cmdlet: Get-NetTCPConnection
.
PS C:\Users\Administrator> Get-NetTCPConnection LocalAddress LocalPort RemoteAddress RemotePort State AppliedSetting ------------ --------- ------------- ---------- ----- -------------- :: 49157 :: 0 Listen :: 49156 :: 0 Listen :: 49155 :: 0 Listen :: 49154 :: 0 Listen :: 49153 :: 0 Listen :: 49152 :: 0 Listen :: 47001 :: 0 Listen ::1 8307 :: 0 Listen :: 445 :: 0 Listen :: 443 :: 0 Listen :: 135 :: 0 Listen 10.10.1.4 49393 162.159.249.151 80 TimeWait 10.10.1.4 49392 65.55.19.43 80 Established Internet 10.10.1.4 49391 122.148.3.200 80 Established Internet 10.10.1.4 49390 64.4.11.25 80 Established Internet 10.10.1.4 49389 141.101.117.172 80 Established Internet 127.0.0.1 49159 127.0.0.1 49158 Established Datacenter 127.0.0.1 49158 127.0.0.1 49159 Established Datacenter 0.0.0.0 49157 0.0.0.0 0 Listen 0.0.0.0 49156 0.0.0.0 0 Listen 0.0.0.0 49155 0.0.0.0 0 Listen 0.0.0.0 49154 0.0.0.0 0 Listen 0.0.0.0 49153 0.0.0.0 0 Listen 0.0.0.0 49152 0.0.0.0 0 Listen 127.0.0.1 8307 0.0.0.0 0 Listen 0.0.0.0 912 0.0.0.0 0 Listen 0.0.0.0 902 0.0.0.0 0 Listen 0.0.0.0 443 0.0.0.0 0 Listen 192.168.233.1 139 0.0.0.0 0 Listen 192.168.231.1 139 0.0.0.0 0 Listen 10.10.1.4 139 0.0.0.0 0 Listen 0.0.0.0 135 0.0.0.0 0 Listen |
This cmdlet: Get-NetAdapterStatistics
gets information about data transferred over a network connection. This is a very useful cmdlet.
PS C:\Users\Administrator> Get-NetAdapterStatistics Name ReceivedBytes ReceivedUnicastPackets SentBytes SentUnicastPackets ---- ------------- ---------------------- --------- ------------------ Ethernet 0 0 0 0 Wi-Fi 37248 153 34451 231 VMware Network Adapte...8 0 0 0 0 VMware Network Adapte...1 0 0 0 0 |
And finally; this cmdlet will get information about your network firewall profile.
PS C:\Users\Administrator> Get-NetFirewallProfile Name : Domain Enabled : True DefaultInboundAction : Block DefaultOutboundAction : Allow AllowInboundRules : NotConfigured AllowLocalFirewallRules : NotConfigured AllowLocalIPsecRules : NotConfigured AllowUserApps : NotConfigured AllowUserPorts : NotConfigured AllowUnicastResponseToMulticast : NotConfigured NotifyOnListen : False EnableStealthModeForIPsec : NotConfigured LogFileName : %systemroot%\system32\LogFiles\Firewall\pfirewall.log LogMaxSizeKilobytes : 4096 LogAllowed : False LogBlocked : False LogIgnored : NotConfigured DisabledInterfaceAliases : {NotConfigured} Name : Private Enabled : True DefaultInboundAction : NotConfigured DefaultOutboundAction : NotConfigured AllowInboundRules : NotConfigured AllowLocalFirewallRules : NotConfigured AllowLocalIPsecRules : NotConfigured AllowUserApps : NotConfigured AllowUserPorts : NotConfigured AllowUnicastResponseToMulticast : NotConfigured NotifyOnListen : False EnableStealthModeForIPsec : NotConfigured LogFileName : %systemroot%\system32\LogFiles\Firewall\pfirewall.log LogMaxSizeKilobytes : 4096 LogAllowed : False LogBlocked : False LogIgnored : NotConfigured DisabledInterfaceAliases : {NotConfigured} Name : Public Enabled : True DefaultInboundAction : NotConfigured DefaultOutboundAction : NotConfigured AllowInboundRules : NotConfigured AllowLocalFirewallRules : NotConfigured AllowLocalIPsecRules : NotConfigured AllowUserApps : NotConfigured AllowUserPorts : NotConfigured AllowUnicastResponseToMulticast : NotConfigured NotifyOnListen : False EnableStealthModeForIPsec : NotConfigured LogFileName : %systemroot%\system32\LogFiles\Firewall\pfirewall.log LogMaxSizeKilobytes : 4096 LogAllowed : False LogBlocked : False LogIgnored : NotConfigured DisabledInterfaceAliases : {NotConfigured} |