Guest User

Untitled

a guest
Dec 11th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. InstanceName value
  2. ------------ -----
  3. intel[r] i350 gigabit network connection 11.85
  4.  
  5. Function Start-Monitoring
  6. {
  7. $Username = 'domainuser'
  8. $Password = 'password'
  9. $pass = ConvertTo-SecureString -AsPlainText $Password -Force
  10.  
  11. $SecureString = $pass
  12. # Uses your password securely
  13. $MySecureCreds = New-Object -TypeName
  14. System.Management.Automation.PSCredential -ArgumentList $Username, $SecureString
  15.  
  16.  
  17. While ($true)
  18. {
  19. # Do things lots
  20. Invoke-command {Get-Counter -Counter "Network Interface(intel[r] i350 gigabit network connection)Bytes Received/sec" -sampleinterval 6 |select -exp countersamples|ft -a instancename,@{l="value";e={[math]::round($_.cookedvalue/.1MB,2)}}} -Credential $MySecureCreds -Verbose -ComputerName ipaddress
  21.  
  22. # Add a pause so the loop doesn't run super fast and use lots of CPU
  23. Start-Sleep 10
  24. }
  25. }
  26. Start-Monitoring
  27.  
  28. #BandTextBox
  29. #
  30. $BandTextBox.Location = '175, 75'
  31. $BandTextBox.Name = 'BandTextBox'
  32. $BandTextBox.Size = '40, 20'
  33. $BandTextBox.TabIndex = 4
  34. $BandTextBox.Text = ''
  35. #
Add Comment
Please, Sign In to add comment