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

Set-SNMPAgent

Synopsis

Configures the SNMP agent information on a local or remote computer.

Syntax

  • Set-SNMPAgent [-Contact] [-Location] [-ServiceTypes] [-ComputerName] [-Credential]

Description

The 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.

Parameters

  • 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.

Inputs

Set-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.

Outputs

Set-SNMPAgent makes changes directly to Windows and does not output any Powershell objects.

Notes

The 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 1

In 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 2

In 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