IIS 7 and Above
Powershell script to export IIS website details
Last post Dec 22, 2015 11:25 AM by Mateiash
Nov 16, 2015 03:40 AM|aurigomsdn|LINK
I need to extract all the website details created in our IIS server with the following details. As we have more than 80 sites created in our IIS server, I am searching for an easier way to export these details.
details required :
I am able to extract all the details except DB related available in connection strings using get-website cmdlet. Requesting your help if you know any better way to extract all the information under single file.
Nov 16, 2015 10:04 PM|Pengzhen Song - MSFT|LINK
You can try using get-webconfiguration and get-webconfigurationproperty cmdlets to get connection string and then extract DBname. For more information, please refer to the document:
And the similar discussion:
Get-WebApplication | `
$webConfigFile = [xml](Get-Content "$($_.PhysicalPath)\Web.config")
Write-Host "Web Application: $($_.path)"
foreach($connString in $webConfigFile.configuration.connectionStrings.add)
Write-Host "Connection String $($connString.name): $($connString.connectionString)"
$dbRegex = "((Initial\sCatalog)|((Database)))\s*=(?<ic>[a-z\s0-9]+?);"
$found = $connString.connectionString -match $dbRegex
Write-Host "Database: $($Matches["ic"])"
Write-Host " "
Hope it can help you.
Dec 22, 2015 11:25 AM|Mateiash|LINK
I have 360 Websites on my IIS, and when I am trying to export to a file (txt or csv), I have just 220 websites listed
There is a buffer limit for appcmd.exe command?