Pages

3/25/2016

powershell ssh

One method for using powershell to ssh to a router/etc:
powershelladmin


Unfortunately it doesn't accept a credential object.
One workaround would be something like the following pseudo code:




import-module ssh-sessions
$cred = get-credential
$user = $cred.getnetworkcredential().username
$pw = $cred.getnetworkcredential().password
(create log file)
(get $list of hosts from file)
(get $commands from file)
(for each $comp in $list)
 (output $comp to log file)
 $loginresult = new-sshsession $comp -username $user -password $pw
 (output $loginresult to log file)
 (for each $cmd in $commands)
  $sshresults = invoke-sshcommand -computername $host -command $cmd
  (output $sshresults to log file)
  }
 $logoutresult = remove-sshsession -computername $comp
 (output $logoutresult to log file)
 }

1/27/2016

tracetcp

tracetcp


The utility available at the link above is very useful.
Instead of requiring icmp, it will perform a traceroute using any TCP port you wish.


VERY useful for testing custom route-map just for tcp 443.  (I could make plain old traceroute work by adding icmp to the route-map, but that isn't really a test.)

12/03/2015

Bandwidth Throttling with Robocopy

Bandwidth throttling with Robocopy

Calculate the /IPG number.

BA=Kbps of circuit

BD=approximate Kbps you want to allow




IPG = ((BA-BD)/BA*BD)*512*1000

10/22/2015

Fix my IT system: Manage Windows Network Bandwidth with native QOS

Fix my IT system: Manage Windows Network Bandwidth with native QOS: Manage Windows Network Bandwidth with native QOS




Windows 2012 QOS!




Get-NetQosPolicy
New-NetQosPolicy
-Name "FileCopy" -SMB -ThrottleRateActionBitsPerSecond 2MB






Set-NetQosPolicy
-Name "FileCopy" -ThrottleRateActionBitsPerSecond 10MB






Remove-NetQosPolicy
-Name "FileCopy"