This cmdlet is part of the Vexasoft Cmdlet Library. You can download it now or click here to find out more.

Remove-SNMPCommunity

Synopsis

Removes an SNMP community from on a local or remote computer.

Syntax

  • Remove-SNMPCommunity [-Community] [-ComputerName] [-Credential]

Description

The Remove-SNMPCommunity cmdlet is used to remove SNMP community strings on the local or a remote computer.

Parameters

  • Community Remove this community string.
  • ComputerName The computer against which to run the cmdlet. By default this parameter will be populated with the name of the local computer.
  • Credential The credentials under which to run the cmdlet. By default this cmdlet will run as the current user. Using this parameter and the Get-PSCredential cmdlet you can specify an alternate set of credentials under which to execute this command.

Inputs

Remove-SNMPCommunity accepts the output of Get-SNMPCommunity as an input object. The Community and ComputerName parameters each accept pipeline input by property name.

Outputs

Remove-SNMPCommunity makes changes directly to Windows and does not output any Powershell objects.

Notes

The Remove-SNMPCommunity cmdlet requires that the RPC service is started on the computer it is trying to access and that DNS services are available to resolve target host names.

Example 1

In this command the community string 'Monitoring' is removed from the remote computer PC01:

Remove-SNMPCommunity -Community Monitoring -Computer PC01

Example 2

The Get-SNMPCommunity cmdlet can be used in conjunction with the Remove-SNMPCommunity cmdlet. In this example all communities configured on the local computer are removed:

Get-SNMPCommunity | Remove-SNMPCommunity