This cmdlet is part of the Vexasoft Cmdlet Library. You can download it now or click here to find out more.
Set-SNMPCommunity
Synopsis
Configures the SNMP communities and community access on a local or remote computer.Syntax
- Set-SNMPCommunity [-Community] [-CommunityAccess] [-ComputerName] [-Credential]
Description
The Set-SNMPCommunity cmdlet is used to configure the SNMP community strings and access levels on the local or a remote computer.Parameters
- Community Add, remove or modify this community string. When adding a community you must also specify the CommunityAccess parameter.
- CommunityAccess Configure the specified community with this community access level. Valid community access levels are None, Notify, ReadOnly, ReadWrite and ReadCreate.
- 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
Set-SNMPCommunity accepts the output of the GetSNMPCommunity cmdlet as an input object. In addition, the Community, CommunityAccess and ComputerName parameters each accept pipeline input by property name.Outputs
Set-SNMPCommunity makes changes directly to Windows and does not output any Powershell objects.Notes
The Set-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 SNMP service of the local computer is configured to grant read only SNMP access to the community string 'Monitoring':Set-SNMPCommunity -Community Monitoring -CommunityAccess ReadOnly
Example 2
The Get-SNMPCommunity cmdlet can be used in conjunction with the Set-SNMPCommunity cmdlet. In this example the communities and community access rights on computer PC01 are replicated on computer PC02:Get-SNMPCommunity -Computer PC01 | Set-SNMPCommunity -Computer PC02