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,