8

It is possible to get the Process ID from this new Com Object ($ie) ?

$ie=New-Object -comobject InternetExplorer.Application  
$ie.visible=$true  
$ie.Navigate("www.stackoverflow.com")
Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316
LaPhi
  • 5,675
  • 21
  • 56
  • 78
  • 1
    Can you explain what you want to use the process ID for? Please note that IE is special as it creates new processes for each tab. – Dirk Vollmar Nov 29 '10 at 14:30
  • Thanks 0xA3 for your answer! I want to check CPU(s). (I know the propertys $ie.busy and $ie.readystate from the Com Object) – LaPhi Nov 29 '10 at 14:50
  • [Determine the Process ID of the Client Process communicating with a COM RPC Server](http://stackoverflow.com/questions/18770684/determine-the-process-id-of-the-client-process-communicating-with-a-com-rpc-serv) + [How can the caller's process be identified in an ATL COM+ out-of-proc server application?](http://stackoverflow.com/questions/35728741/how-can-the-callers-process-be-identified-in-an-atl-com-out-of-proc-server-app). – Roman R. Apr 06 '16 at 10:03

1 Answers1

8

The following will give you the parent IE process:

(Get-Process -Name iexplore)| Where-Object {$_.MainWindowHandle -eq $ie.HWND}
Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316