SynopsisConfigures the SNMP communities and community access on a local or remote computer.
- Set-SNMPCommunity [-Community] [-CommunityAccess] [-ComputerName] [-Credential]
DescriptionThe Set-SNMPCommunity cmdlet is used to configure the SNMP community strings and access levels on the local or a remote computer.
- 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.
InputsSet-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.
OutputsSet-SNMPCommunity makes changes directly to Windows and does not output any Powershell objects.
NotesThe 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 1In 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 2The 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