Search code examples
iis-7appcmd

Use appcmd to list files/folders with windows authentication in IIS7


is there any way to use Use appcmd to list all of the files/folders with windows authentication set in IIS7?

Cheers

Batesy


Solution

  • Not easily, have you considered using Configuration Editor "Search" feature? Or does it have to be command line?

    Using the UI, just go to Configuration Editor (available in IIS 7.5 or for download for IIS 7.0 ) and click the "Search Configuration...", then just type windowsAuthentication in the search box and you will see every single configuration that is using that, either locally or distributed. This way you can see all the sites or applications that have it set.

    PowerShell could be another option which is a bit more complicated but very powerfull. For example:

    Get-WebConfiguration /system.webServer/security/authentication/* -recurse |  
          select-object @{Name="Path"; Expression={$_.PSPath.Substring(16) + ' ' + $_.Location}},   
              @{Name="Scheme"; Expression = {$_.SectionPath.Substring(42)}}, 
              Enabled