Powershell: how can I retrieve a list of memory usage by iexplore.exe URL

For each Iexplore.exe process I need to retrieve the following using powershell;

URL                            Memory Usage(K)
http://www.google.com          80796
http://www.yahoo.com           34748

I only open 1 URL per Iexplore.exe process (no tabs).

get-process iexplore gives me good view of memory usage per process id. For example;

PS> get-process iexplore

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
-------  ------    -----      ----- -----   ------     -- -----------
    870      87    80796      15900   429    27.10   1720 iexplore
    850      82    34748      28548 -1781    23.04   3640 iexplore

and this snippet gives me the URLs that are open

PS> $urls = (New-Object -ComObject Shell.Application).Windows()
PS> $urls | where-object { $_.name -eq "Internet Explorer"} | ForEach-Object {$_.LocationUrl, $_.name} 

https://some url .com
Internet Explorer
https://some url .com
Internet Explorer

But I dont know how to combine these concepts if at all possible. Alternatively anything that can give me the required output will suffice.

Reason:

We run several business objects dashboard as .SWF files in IE browsers, and a few other web page based dashboards. then the video output of the server they run on are connected to various large format 1920x1080 displays.

Over time we get memory leak in IE.

This would allow us to monitor / log the memory usage over time of each Iexplore.exe process, and know which URL that process is accessing.

Many thanks in advance.

Sorry if the formatting of this post is crappy. Its my first time!

Answers


You can determine the process using the MainWindowHandle:

$ieInstances = (New-Object -ComObject Shell.Application).Windows()  | where-object { $_.name -eq "Internet Explorer"}
$ieInstances | select LocationUrl, @{e={(Get-Process -Name iexplore| Where-Object MainWindowHandle -eq $_.HWND | select -expand PM)}; l="Memory Usage(K)"}

Need Your Help

Spring: Error wiring DataSource java security configuration

java spring security spring-mvc jdbc

I'm not able to ruin my webapp (Spring MVC based) in tomcat. I'm getting this error when trying to configure security over JDBC:

What is the most efficient way to deliver the same functionality on Windows Mobile, Android & Blackberry?

android windows-mobile blackberry

What is the most efficient way to deliver the same set of functions on different mobile platforms (Windows, Blackberry & Android, possibly iPhone)?