SynopsisRemoves SNMP trap communities or trap destinations configured on a local or remote computer.
- Remove-SNMPTrapCommunity [-TrapCommunity] [-TrapDestination] [-ComputerName] [-Credential]
DescriptionThe 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.
InputsRemove-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.
OutputsRemove-SNMPTrapCommunity makes changes directly to Windows and does not output any Powershell objects.
NotesThe 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 1In this command the trap destination 192.168.1.44 is removed from the trap community Monitoring on the local computer.
Remove-SNMPTrapCommunity -TrapCommunity Monitoring -TrapDestination 192.168.1.44
Example 2In this command the trap community 'Monitoring' is removed from the remote computer PC01.
Remove-SNMPTrapCommunity -TrapCommunity Monitoring -Computer PC01
Example 3The 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