Quantcast
Viewing all articles
Browse latest Browse all 252940

SNMP configuration with powerCLI

Hi people,

 

I'm looking for a script to enable and update snmp configuration on close to 400 esxi 5.0/5.1 hosts.. I know we can use Set-VMHostsnmp cmdlet for this purpose but getting stuck with where and how to start..

 

Here is what I'm thinking to do.. please let me know if this works or guide me through the right way...

 

$esxlist =Import-Csv"C:\Scripting\Servers.txt"

foreach($itemin$esxlist){

Connect-VIServer $item

-Userroot-Passwordxxx

$item| Set-VMHostSnmp-Enabled:$true

Set-VMHostSnmp

-HostSnmp$_-ReadOnlyCommunity"Name"-TargetHost"1.1.1.1"

Disconnect-VIServer -Confirm:$false

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Regards,

VMSavvy Image may be NSFW.
Clik here to view.


Viewing all articles
Browse latest Browse all 252940

Trending Articles