SynopsisConfigures the SNMP agent information on a local or remote computer.
- Set-SNMPAgent [-Contact] [-Location] [-ServiceTypes] [-ComputerName] [-Credential]
DescriptionThe Set-SNMPAgent cmdlet is used to configure the SNMP agent information, such as contact, location and service types, on the local or a remote computer.
- Contact Register this contact for the host.
- Location Register this location for the host.
- ServiceTypes Register the host as managing these service types. Valid types are None, Physical, Datalink, Internet, EndtoEnd and Applications. You can specify multiple types to the parameter separated by a comma.
- 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-SNMPAgent accepts the output of the Get-SNMPAgent cmdlet as an input object. In addition, the Contact, Location, ServiceTypes and ComputerName parameters each accept pipeline input by property name.
OutputsSet-SNMPAgent makes changes directly to Windows and does not output any Powershell objects.
NotesThe Set-SNMPAgent 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 agent of the remote computer Serv01 is configured with contact name and location information for use when replying to SNMP queries:
Set-SNMPAgent -Contact ASmith -Location "Room 26B" -Computer Serv01
Example 2In this command the SNMP agent of the local computer is configured with contact name and location information as above and is also supplied with service information. Notice that service information is supplied as comma seperated strings or alternatively can be supplied as a string array object:
Set-SNMPAgent -Contact ASmith -Location "Room 26B" -Services Physical,DataLink,Application