I want to calculate the bytes sent and recieved by a particular process .I want to use powershell for that. Something which I can do using Resource Monitor->Network Activity. How can i do that using get-counter?
Access your router by entering your router's IP address into a web browser. Once you sign in, look for a Status section on the router (you might even have a Bandwidth or Network Monitor section depending on the type of router). From there, you should be able to see the IP addresses of devices connected to your network.
Windows PowerShell is an essential admin tool designed specifically for Windows administration. By learning to use Windows PowerShell, network administrators quickly gain access to information from Windows Management Instrumentation, Active Directory and other essential sources of information.
The Get-Process cmdlet gets the processes on a local or remote computer. Without parameters, this cmdlet gets all of the processes on the local computer. You can also specify a particular process by process name or process ID (PID) or pass a process object through the pipeline to this cmdlet.
There is a really good Scripting Guy article on using the Get-Counter
cmdlet here:
Scripting Guy - Get-Counter
The trick will be finding the counter that you need, and I don't think you can get the granularity you're after as these are the same counters that PerfMon uses. It's more focused around the whole Network Interface than it is around the individual processes using the interface. With that said, if it's the only thing using the given interface it should do the trick nicely.
Have a look at the Network Interface options available for a start:
(get-counter -list "Network Interface").paths
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With