BranchCache stats
This script will summarize the utilization of BranchCache on a single PC client…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$computer = $env:COMPUTERNAME $namespace = "ROOT\cimv2" $classname = "Win32_PerfFormattedData_PeerDistSvc_BranchCache" [Double]$percentage = 0.0 $BranchCacheObject = Get-WmiObject -Class $classname -ComputerName $computer -Namespace $namespace $bytestotal = $BranchCacheObject.RetrievalBytesfromserver + $BranchCacheObject.RetrievalBytesfromcache Write-host "COMPUTER : $computer " if ($bytestotal -gt 0) { $percentage = $BranchCacheObject.RetrievalBytesfromcache * 100 / ($BranchCacheObject.RetrievalBytesfromserver + $BranchCacheObject.RetrievalBytesfromcache) Write-Host "$(([math]::Round($percentage,2))) %" Write-Host "$(([math]::Round($bytestotal/(1024*1024),2))) MB" } else { Write-host "$percentage %" Write-Host "$(([math]::Round($bytestotal/(1024*1024),2))) MB" } |