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



Removes SNMP trap communities or trap destinations configured on a local or remote computer.


  • Remove-SNMPTrapCommunity [-TrapCommunity] [-TrapDestination] [-ComputerName] [-Credential]


The Remove-SNMPTrapCommunity cmdlet is used to remove SNMP trap communities and trap destinations on the local or a remote computer.


  • TrapCommunity Remove this trap community from the computer or, if a trap destination is specified, remove the trap destination from this trap community.
  • TrapDestination Remove this trap destination from the specified trap community. When removing a trap destination you must specify the TrapCommunity parameter.
  • 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.


Remove-SNMPTrapCommunity accepts the output of the Get-SNMPTrapCommunity cmdlet as input. In addition, the TrapCommunity, TrapDestination and ComputerName parameters each accept pipeline input by property name.


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


The Remove-SNMPTrapCommunity 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 trap destination is removed from the trap community Monitoring on the local computer.

Remove-SNMPTrapCommunity -TrapCommunity Monitoring -TrapDestination

Example 2

In this command the trap community 'Monitoring' is removed from the remote computer PC01.

Remove-SNMPTrapCommunity -TrapCommunity Monitoring -Computer PC01

Example 3

The Remove-SNMPTrapCommunity cmdlet can be used in conjunction with the Get-SNMPTrapCommunity cmdlet. In this example all of the trap communities and destinations are removed from the local computer.

Get-SNMPTrapCommunity | Remove-SNMPTrapCommunity