Powershell WMI queries

Hi

I am trying to find out how to query the following settings using Powershell WMI, however have hit a wall. Is anyone aware?

NIC name/ description
Speed/Duplex


On the NIC, the following options enabled or disabled

Client for MS Windows
QoS Packet Scheduler
File and Printer Sharing

etc

Is this possible?

May 24th, 2013 12:52am

You can start with:

$NICs = Get-WmiObject Win32_NetworkAdapterConfiguration

ForEach ($NIC in $NICS)
	{
	$NIC.<property>
	}

There are lots of properties. An example from one of my NICs:

PSComputerName               : MyComputer
DHCPLeaseExpires             : 20130524175202.000000+120
Index                        : 10
Description                  : Realtek PCIe GBE Family Controller
DHCPEnabled                  : True
DHCPLeaseObtained            : 20130523175202.000000+120
DHCPServer                   : 192.168.0.1
DNSDomain                    :
DNSDomainSuffixSearchOrder   : {MYDOMAIN.NET}
DNSEnabledForWINSResolution  : False
DNSHostName                  : MyComputer
DNSServerSearchOrder         : {192.168.0.2, 2.2.2.2}
DomainDNSRegistrationEnabled : False
FullDNSRegistrationEnabled   : True
IPAddress                    : {192.168.0.12, fe80::39c5:b5db:1040:76c8}
IPConnectionMetric           : 10
IPEnabled                    : True
IPFilterSecurityEnabled      : False
WINSEnableLMHostsLookup      : True
WINSHostLookupFile           :
WINSPrimaryServer            :
WINSScopeID                  :
WINSSecondaryServer          :
__GENUS                      : 2
__CLASS                      : Win32_NetworkAdapterConfiguration
__SUPERCLASS                 : CIM_Setting
__DYNASTY                    : CIM_Setting
__RELPATH                    : Win32_NetworkAdapterConfiguration.Index=10
__PROPERTY_COUNT             : 61
__DERIVATION                 : {CIM_Setting}
__SERVER                     : MyComputer
__NAMESPACE                  : root\cimv2
__PATH                       : \\MyComputer\root\cimv2:Win32_NetworkAdapterConfiguration.Index=10
ArpAlwaysSourceRoute         :
ArpUseEtherSNAP              :
Caption                      : [00000010] Realtek PCIe GBE Family Controller
DatabasePath                 : %SystemRoot%\System32\drivers\etc
DeadGWDetectEnabled          :
DefaultIPGateway             : {192.168.0.1}
DefaultTOS                   :
DefaultTTL                   :
ForwardBufferMemory          :
GatewayCostMetric            : {0}
IGMPLevel                    :
InterfaceIndex               : 12
IPPortSecurityEnabled        :
IPSecPermitIPProtocols       : {}
IPSecPermitTCPPorts          : {}
IPSecPermitUDPPorts          : {}
IPSubnet                     : {255.255.255.0, 64}
IPUseZeroBroadcast           :
IPXAddress                   :
IPXEnabled                   :
IPXFrameType                 :
IPXMediaType                 :
IPXNetworkNumber             :
IPXVirtualNetNumber          :
KeepAliveInterval            :
KeepAliveTime                :
MACAddress                   : XXXX:XX:XX:XX:XX
MTU                          :
NumForwardPackets            :
PMTUBHDetectEnabled          :
PMTUDiscoveryEnabled         :
ServiceName                  : RTL8168
SettingID                    : {9DBFD72F-68B6-4BAA-B7B4-2989464611DD}
TcpipNetbiosOptions          : 0
TcpMaxConnectRetransmissions :
TcpMaxDataRetransmissions    :
TcpNumConnections            :
TcpUseRFC1122UrgentPointer   :
TcpWindowSize                :
Scope                        : System.Management.ManagementScope
Path                         : \\MyComputer\root\cimv2:Win32_NetworkAdapterConfiguration.Index=10
Options                      : System.Management.ObjectGetOptions
ClassPath                    : \\MyComputer\root\cimv2:Win32_NetworkAdapterConfiguration
Properties                   : {ArpAlwaysSourceRoute, ArpUseEtherSNAP, Caption, DatabasePath...}
SystemProperties             : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY...}
Qualifiers                   : {dynamic, Locale, provider, UUID}
Site                         :
Container                    :

Things like File and Printer Sharing have nothing to do with the network card and have to be queried differently. I have to go to sleep now, sorry, but this shows you something at least :)

Free Windows Admin Tool Kit Click here and download it now
May 24th, 2013 1:16am

Hi,

Use the code Jelle posted above for name/description. As for speed/duplex, that gets much more difficult. See these links for information:

http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/9446bf15-bdbd-470c-a04c-11f2f4e1d9f3/

http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/1f44b078-ffb7-4403-88b8-2e75118b643c/

http://www.peetersonline.nl/2008/08/gather-nic-properties-including-speed-and-duplex/

http://itknowledgeexchange.techtarget.com/powershell/network-adapter-speed-and-duplex/

As for the NIC options, try out this tool:

http://archive.msdn.microsoft.com/nvspbind (via this thread)




May 24th, 2013 3:15am

Hi,

We had this problem reading the speed and duplex settings which are stored in the registry here
SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\index

However some posts have made this sound simpler to read than it is.
Intel write to the *SpeedDuplex value
HP/Compaq to RequestedMediaType
RealTek to *SpeedDuplex (but use different values to Intel).

We were working with this with our Windows server audit tool if anyone is looking to get this information this might help with there's a free version if you're just looking at a small number of machines.
I'm going to look at the File and Printer Sharing and QoS Packet Scheduler which is what brought me to this page, will post back if I get anywhere with that!



Thanks,

Dave

January 30th, 2015 1:05pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics