How do I get workproccess object for application pool? [Answered]RSS

3 replies

Last post Sep 24, 2013 01:56 AM by Angie xu - MSFT

  • How do I get workproccess object for application pool?

    Sep 13, 2013 01:56 PM|artisticcheese|LINK

    Seemingly right flow below do not work.

    $pools = gci IIS:\apppools

    $pools[2].WorkerProcesses[0].ProcessID

    There is worker process associated with Pool 3 and yet I can not access any properties or methods of WorkProcess[] collection in that pool.

  • Re: How do I get workproccess object for application pool?

    Sep 16, 2013 04:56 AM|Angie xu - MSFT|LINK

    Hi,

    $pools = gci IIS:\apppools

    $pools[2].WorkerProcesses[0].ProcessID

    It seems to be ok for the codes above.

     I think you could provide more information and explanation, then we can give more precise troubleshooting for your problem,

    Regards

    Angie xu

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.
  • Re: How do I get workproccess object for application pool?

    Sep 16, 2013 07:41 AM|artisticcheese|LINK

    Angie xu - MSFT

    Hi,

    $pools = gci IIS:\apppools

    $pools[2].WorkerProcesses[0].ProcessID

    It's ok for the codes above.

     I think you could provide more information and explanation, then we can give more precise troubleshooting for your problem,

    Regards

    Code abover works for you and returns result? Can you post example here? 

    Appears to be WorkerProcesses is not actually a collection and instead you have to access property called Collection to retrive individual members

  • Re: How do I get workproccess object for application pool?

    Sep 24, 2013 01:56 AM|Angie xu - MSFT|LINK

    Hi artisticcheese

    artisticcheese

    $pools[2].WorkerProcesses[0].ProcessID

    WorkerProcesses property isn’t a collection, so give a modification to $pools[2].WorkerProcesses.Collection[0].ProcessID,

    Regards

     

    Angie xu

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.