Share via


Windows 10 1809 SNMP adding from the command line

Question

Monday, October 8, 2018 6:01 PM

Hello

W10 1809 is getting fixed up, I am aware.  However, I've noticed that certain options no longer work.  For example, I need to automate adding SNMP and configuring it.  I used to use Get-WindowsOptionalFeature to add it, however, it no longer appears to be an option.

Also, you can no longer add SNMP via add/remove programs, it needs to be added as "an additonal feature".  

If anyone can suggest a way to automate via powershell SNMP, that would be incredibly helpful. I don't understand why Microsoft would change this, but it would be nice if I could get a step by step process for scripting out the addition of SNMP for W10 1809.  Thank you.

All replies (14)

Monday, October 8, 2018 7:27 PM | 7 votes

Hi,

Try this:

Get-WindowsCapability  -Online -Name "SNMP*"

Then to install it run:

Add-WindowsCapability  -Online -Name "SNMP.Client~~~~0.0.1.0"

Then check again that it got installed:

Hope this was useful!

Best regards,
Leon

Blog: https://thesystemcenterblog.com LinkedIn:


Thursday, October 11, 2018 3:29 PM

Fantastic, thanks so much.  Worked like a charm!


Thursday, October 11, 2018 3:33 PM

Glad to hear, you're welcome! :)

Don't forget to mark as answer if this helped you.

Blog: https://thesystemcenterblog.com LinkedIn:


Friday, November 23, 2018 7:37 AM

For me the Add-WindowsCapability command leads to an error:

Add-WindowsCapability : Add-WindowsCapability failed. Error code = 0x800f0954
At line:1 char:1

  • Add-WindowsCapability  -Online -Name "SNMP.Client~~~~0.0.1.0"

    + CategoryInfo          : NotSpecified: (:) [Add-WindowsCapability], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.AddWindowsCapabilityCommand

Any other ideas?


Friday, November 23, 2018 7:49 AM | 1 vote

What do you get if you run the following:

Get-WindowsCapability -Online | ? Name -like 'SNMP.Client*'

Blog: https://thesystemcenterblog.com LinkedIn:


Friday, November 23, 2018 7:53 AM

I get:

Name  : SNMP.Client~~~~0.0.1.0
State : NotPresent


Friday, November 23, 2018 7:56 AM | 2 votes

As a temporary workaround, try changing the registry key “UseWUServer” to 0.

It is located at:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU

Blog: https://thesystemcenterblog.com LinkedIn:


Friday, November 23, 2018 8:06 AM

Yes, that's it. You're my hero for today. :-)


Friday, November 23, 2018 8:19 AM

Glad it worked out for you! You may vote as helpful if you think this was useful information!

Blog: https://thesystemcenterblog.com LinkedIn:


Friday, January 25, 2019 7:46 AM

All that above dosn't work for me.

After command

Add-WindowsCapability  -Online -Name "SNMP.Client~~~~0.0.1.0"

it seems like installing, but it wasn't installed.

PS C:\Users\Administrator> Get-WindowsCapability  -Online -Name "SNMP*"


Name         :
State        : NotPresent
DisplayName  :
Description  :
DownloadSize : 0
InstallSize  : 0

I have found other solution.

In Settings (modern) -> Apps -> Manage optional features -> (here wasn't SNMP) Add a feature: WMI SNMP Provider.

After that on the list of optional features is Simple Network Management Protocol (SNMP) and WMI SNMP Provider.

PS C:\Users\Administrator> Get-WindowsCapability -Online -Name "SNMP*"


Name         : SNMP.Client~~~~0.0.1.0
State        : Installed
DisplayName  : Simple Network Management Protocol (SNMP)
Description  : This feature includes Simple Network Management Protocol agents that monitor the activity in network
               devices and report to the network console workstation
DownloadSize : 613638
InstallSize  : 1129119

Now in Services.msc is a new service SNMP Service.

Regards

P.S. I know, this is not from cmd line.


Tuesday, April 2, 2019 8:07 AM

Hi Leon Laude,

thanks so much to share this information.

Best regards


Saturday, July 6, 2019 2:27 AM

Thanks this worked out like a "charm"!  


Tuesday, March 3, 2020 9:09 AM | 1 vote

None of this worked for my Windows 10 v1909, however, these Powershell commands installed the SNMP service for me:

Get-WindowsCapability -Online -Name "SNMP*"
Set-ItemProperty "REGISTRY::HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" UseWUserver -value 0
Get-Service wuauserv | Restart-Service
Add-WindowsCapability -Online -Name "SNMP.Client~~~~0.0.1.0"
Set-ItemProperty "REGISTRY::HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" UseWUserver -value 1
Get-WindowsCapability -Online -Name "SNMP*"

Fist and last commands are to check current SNMP install state


Wednesday, May 6, 2020 8:59 PM

Amnon, thank you!  This option did the trick.

I did repeat the "Restart-Service" command, to make sure the 'UseWUserver -value 1' was active without a reboot.