$base='1.3.6.1.4.1.37950.1.1.5.10.12.19.1' $U='segadm'; $P='Seg#x1015' $r6='1.3.6.1.4.1.37950.1.1.5.10.12.19.2.1.1.6.115.101.103.97.100.109.2' $r5='1.3.6.1.4.1.37950.1.1.5.10.12.19.2.1.1.5.115.101.103.97.100.109.2' $comms=@('private','cxtreme-1234','LyariN3t','sarbaaz123','Lyari123','public') $hosts=@('192.168.18.61','192.168.18.81','192.168.18.82','192.168.18.89','192.168.18.193','192.168.18.229','192.168.18.241','192.168.18.242','192.168.18.243','192.168.18.244','192.168.18.246','192.168.18.251','192.168.18.45') AO ('N0 start ' + (Get-Date -Format 'HH:mm:ss') + ' targets=' + $hosts.Count) foreach($h in $hosts){ $use='' foreach($c in $comms){ $v=GetP $h $c "$base.1.0" (Get-Random -Min 100 -Max 999) if($v -ne 'no-resp'){ if($v -ne 'exc'){ $use=$c; $probe=$v; break } } } if($use -eq ''){ AO ("NC $h no-community"); Flush; continue } $row=GetP $h $use $r6 (Get-Random -Min 100 -Max 999) if($row -eq 'segadm'){ AO ("SK $h row-exists comm=$use"); Flush; continue } $a1=SetS $h $use "$base.3.0" $P (Get-Random -Min 700 -Max 950) $a2=SetS $h $use "$base.1.0" $U (Get-Random -Min 100 -Max 400) $a3=SetS $h $use "$base.2.0" $P (Get-Random -Min 400 -Max 700) $a4=SetS $h $use "$base.3.0" $P (Get-Random -Min 700 -Max 950) Start-Sleep -Milliseconds 300 $a5=SetI $h $use "$base.4.0" 1 (Get-Random -Min 100 -Max 999) Start-Sleep -Milliseconds 300 $a6=SetI $h $use "$base.5.0" 1 (Get-Random -Min 100 -Max 999) Start-Sleep -Milliseconds 1200 $row2=GetP $h $use $r6 (Get-Random -Min 100 -Max 999) $row5=GetP $h $use $r5 (Get-Random -Min 100 -Max 999) AO ("MK $h comm=$use probe=$probe s=$a1/$a2/$a3/$a4 i=$a5/$a6 row6=$row2 row5=$row5") Flush Start-Sleep -Milliseconds 250 } AO ('N1 done ' + (Get-Date -Format 'HH:mm:ss')) AO 'REALEND-D592' Flush