Question

I want to modify a setting for a particular website via commandline, but I'm having trouble finding the syntax for the command.

I want to change the following xml section in the file c:/inetpub/wwwroot/wss/VirtualDirectories//web.config.

<configuration>...
   <SharePoint>...
     <BlobCache location="x">

I know I can modify the file C:\Windows\System32\inetsrv\config\applicationhost.conf via appcmd, but I can't figure out how to modify a particular web site's web.config file. I'm guessing I need to do something like this

appcmd set config "<site name>" /section:sharepoint/blobcache /enabled="true" /commit:site

But that attempts to modify the file applicationhost.conf.

What would be the syntax to modify the web.config file, or is there another utility that can do a better job than appcmd?

Was it helpful?

Solution

Since you tagged this question with SharePoint 2010 I would suggestion using a PowerShell script to do this. Scripting Guy over on technet.com has a blog post that describes doing exactly this.

His solution has you using the SPWebConfigModification class to manipulate the web.config for an existing web application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top