On an internal PowerShell scripting DL the question was posed as to how one would get a list of applications with firewall exceptions. Here was the answer that I sent:
function getfwexceptions
{
$fwmgr = (new-object -com hnetcfg.fwmgr).localpolicy.currentprofile
$fwmgr.authorizedapplications
}
This function instantiates an instance of the HNetCfg.FwMgr COM object and gives you back something like this:
Name : Internet Explorer
ProcessImageFileName : C:\program files\internet explorer\iexplore.exe
IpVersion : 2
Scope : 0
RemoteAddresses : *
Enabled : True
Of course, with PowerShell you're passing around objects and can filter this output to your liking.
Happy scripting!