You can use XPath XML queries against config files to look for the <authentication> tag and retrieve its mode attribute value. Better yet, use some existing scripted capability for this. There are Powershell commandlets for IIS. Take a look at the Get-WebConfiguration cmdlet as discussed here. It even has XPath capabilities.
If you want to roll your own XPath query, it would look something like
XmlDocument doc = new XmlDocument();
doc.load("PATH TO A CONFIG FILE HERE");
XmlNode authenticationNode = doc.SelectSingleNode("//system.web/authentication");
//Value of attribute is at
var authenticationMode = authenticationNode.Attributes["mode"].Value;
However this approach does not deal with the fact that IIS composites config files from higher level directories with lower level ones--this just reads on particular file. So you'd have to add some logic to see what authentication is truly in effect at a given folder level.
A better way might be to do reflection on the AppDomain of your web application, read the config that way and then check the value.
Or you try this from MSDN documentation