I want to access the name and status of the application pool with .NET core
We used to either manually check the status or use different tools to check the status of the application pools in IIS. But the update and removal with these tools is still a manual job which people tend to forget.
I tried to do this:
public static void GetApplicationPoolNames()
{
ServerManager manager = new ServerManager();
Site defaultSite = manager.Sites["Default Web Site"];
foreach (Application app in defaultSite.Applications)
{
Console.WriteLine(
"{0} is assigned to the '{1}' application pool.",
app.Path, app.ApplicationPoolName);
}
}
but this is only for my local IIS installation. I like to access a different IIS server and retrieve this information. Is it nescessary that I host the application within the same IIS pool? Or can it be a standalone project?