locked
PowerShell problem in 1809, with get-netadapter. RRS feed

  • Question

  • Hi

    PS C:\> get-date
    03 February 2019 10:31:23
    PS C:\> Get-NetAdapter
    Get-NetAdapter : Invalid class
    At line:1 char:1
    + Get-NetAdapter
    + ~~~~~~~~~~~~~~
        + CategoryInfo          : MetadataError: (MSFT_NetAdapter:ROOT/StandardCimv2/MSFT_NetAdapter) [Get-NetA
       dapter], CimException
        + FullyQualifiedErrorId : HRESULT 0x80041010,Get-NetAdapter

    So......

    In 1803 the above definitely produced the correct output, have I changed something inadvertently, or MS have a bug?

    I am still trying to find a result, DuckDuckGo is still quacking.

    • Moved by Bill_Stewart Friday, March 15, 2019 7:02 PM This is not "break/fix" forum
    Sunday, February 3, 2019 12:32 PM

Answers

All replies

  • It appears that something has become corrupted. I find several instances where people have reported your error message, but no fix reported. The cmdlet works fine for me.

    Richard Mueller - MVP Enterprise Mobility (Identity and Access)

    Sunday, February 3, 2019 1:02 PM
  • In this thread the problem was caused by corrupt WMI. The fix is shown:

    https://social.technet.microsoft.com/Forums/en-US/c3eb5884-8185-4dd3-a4a4-5c9f52d0654a/network-adapters-nic-doesnt-show-up-in-nic-teaming-manager

    using this script to repair WMI:

    @echo off
    sc config winmgmt start= disabled
    net stop winmgmt /y
    %systemdrive%
    cd %windir%\system32\wbem
    for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
    wmiprvse /regserver 
    winmgmt /regserver 
    sc config winmgmt start= Auto
    net start winmgmt
    for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s


    Richard Mueller - MVP Enterprise Mobility (Identity and Access)

    Sunday, February 3, 2019 1:08 PM
  • Hi

    Apologies for the time lag, but

    PS C:\> get-date

    26 September 2019 14:42:32

    Thank you.

    Thursday, September 26, 2019 1:43 PM