$webapp.Parent.ApplyWebConfigModifications() は、ファーム内のすべての Web アプリケーションを更新します。
たとえば、SharePoint ファームに 2 つの Web アプリケーションがあります。
webapp1 webapp2
webapp1 に web.config の更新があり、以下は powershell を使用したコードです。
$webapp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup($url)
$change = new-object "Microsoft.SharePoint.Administration.SPWebConfigModification"
$webapp.WebConfigModifications.Add($change)
$webapp.Update()
$webapp.Parent.ApplyWebConfigModifications()
このコードは webapp1 と webapp2 で機能しますが、webapp2で実行すると、webapp1 構成ファイルにも更新が表示されます。ここに何か欠けていますか????