2

How can one get the Advanced network settings > Data usage statistics in Windows 11 using PowerShell?

enter image description here

I couldn't figure out how to get the total data consumption per process using Get-NetAdapterStatistics.

Ayan Mullick
  • 486
  • 1
  • 6
  • 14

1 Answers1

2

I'm not aware of a native API that exposes this information, either WMI or Performance Monitor, which is typically what is leveraged by PowerShell. The network usage data is stored in a Microsoft Jet database, located at: C:\Windows\System32\sru\SRUDB.dat. This is functionality included in the System Resource Usage Monitor (SRUM), which is part of the Diagnostic Policy Service.

More information:

https://velociraptor.velocidex.com/digging-into-the-system-resource-usage-monitor-srum-afbadb1a375?gi=86dfb98a4bb6

https://www.ghacks.net/2017/06/28/networkusageview-lists-windows-network-usage-data/

Greg Askew
  • 34,339
  • 3
  • 52
  • 81
  • I wish someone [Crescendo](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.crescendo/?view=ps-modules)'d the [NirSoft ESEDatabaseView CLI](https://www.nirsoft.net/utils/ese_database_view.html) tool. – Ayan Mullick Aug 14 '22 at 21:22
  • @AyanMullick: I don't think that would be needed. It's a database with a simple table. This could be a TSQL cmdlet or similar. – Greg Askew Aug 15 '22 at 00:06
  • Is there an example of the TSQL to query the data consumption per process from SRUDB.dat so that one could query it from a Windows terminal? – Ayan Mullick Aug 15 '22 at 00:28