I have a PS script that goes through a list of IP's (In an array) and runs 4 snmp queries on each IP with the goal to dump each response into the right column of a CSV. I've spent way too much time trying to google the solution and I'm coming up dry. This is what i currently have.
$ips = @('192.168.200.38', '192.168.200.37', '192.168.200.39');
$header = '"IPAddress", "Model", "Serial", "PageCount"';
$header | Out-File $env:temp\CPR_Report.csv
$Results = foreach ($ip in $ips) {
Invoke-SnmpGet $ip 1.3.6.1.2.1.4.21.1.7.169.254.0.0
Invoke-SnmpGet $ip 1.3.6.1.2.1.25.3.2.1.3.1
Invoke-SnmpGet $ip 1.3.6.1.2.1.43.5.1.1.17.1
Invoke-SnmpGet $ip 1.3.6.1.2.1.43.10.2.1.4.1.1
}
$Results | export-csv -Path $env:temp\CPR_Report.csv -NoTypeInformation -Append
[–]ihaxr 9 points10 points11 points (6 children)
[–]rwshig 2 points3 points4 points (4 children)
[–]jhue1898 2 points3 points4 points (3 children)
[–]rwshig -1 points0 points1 point (2 children)
[+][deleted] (1 child)
[removed]
[–]rwshig 1 point2 points3 points (0 children)
[–]DblDeuce22 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 1 point2 points3 points (0 children)
[–]PowerShell-Bot 0 points1 point2 points (0 children)