Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing an upgrade application for my client and I want to know if I can pull up authentication details for the app pool of my application.
For instance, I want to know if "Windows Authentication" or "Forms authentication" is disabled/enabled? Can I pull the information and then store it into a text file?
Any direction? Any help would be greatly appreciated.
Thank you.

What I have tried:

Nothing, I have been looking up the solution online. I cant seem to phrase the query properly to find a solution.
Posted
Updated 17-Aug-18 6:45am
Comments
[no name] 17-Aug-18 1:56am    
As it relates to what? "Where" specifically are you required to provide credentials?

Eg. SQL Server authentication can be explicit or via Windows credentials.

1 solution

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.
 
Share this answer
 
Comments
09hadi 27-Aug-18 11:02am    
This was really helpful. I got all the app pools and that helped me pull my specific app pool.
Eric Lynch 27-Aug-18 12:54pm    
Great news, happy it helped.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900