Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

AdvancedLogging Configuration per Site

$
0
0

Hi,

I have this script:

========================

$Sites = Get-Website | Select Name $Site = $Site.Name

Foreach ($Site in $Sites){ & "C:\Windows\System32\inetsrv\appcmd.exe" set config $Site.Name -section:system.applicationHost/sites -"[name='$Site'].advancedLogging.directory:C:\inetpub\logs\AdvancedLogs\$Site" /commit:apphost

}

========================

The script is expected to get all the sites on the IIS and configure the AdvancedLog location per site using appcmd. Unfortunately, this part doesn't take the variable I set ("[name='$Site'].advancedLogging.directory:C:\inetpub\logs\AdvancedLogs\$Site") which is $Site.

 

What I want to do here is for each site that is on the IIS, it will configure the AdvancedLogging location per site on a specific folder per site.

 

Thanks,


Viewing all articles
Browse latest Browse all 780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>