I cannot provide a full answer. However, since you haven't received any better responses yet, I can at least share some information that may help you.
There is a
Microsoft.Web.Administration
namespace that allows you to access some of this information. You'll want to get the latest NuGet package with the same name (11.1.0 as of Aug 17, 2018).
You can find some of the details of the API here:
Microsoft.Web.Administration Namespace[
^]
There is a lot of application pool information available. Though, I don't have time to research the specific information you need, so I can't say for certain it is available.
The following code should give you a starting point in your own research. It worked fine for me on Win 10, but required elevated permissions, so I tested running as administrator.
using System;
using Microsoft.Web.Administration;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
var manager = new ServerManager();
foreach (ApplicationPool pool in manager.ApplicationPools)
Console.WriteLine(pool.Name);
}
}
}
Hope this helps. Best of luck.