Search code examples
c#iis-7cmdvirtual-directorymicrosoft-bits

Enable BITS Uploads for virtual directory programmatically in IIS7


In IIS7 under the feature called "BITS Uploads" for virtual directories, there is a checkbox for "Allow clients to upload files" I need to enable this checkbox for specific virtual directory and also for "Default Web Site"

Can this be done in C# or even in a command line so I can run it throught script\C#?

Thanks!

Edit: After investigating the changes of applicationHost.config it is possible to modify this Xml file however with a lot of changes (including GUID changes) But it does not feel right...i hoped that appcmd.exe\c# could supply me a solution for this small but important requirment. I will be really greatfull if someone can post a better solution for this problem Thanks, Lior


Solution

  • I've figured a better way to configure IIS automatically. For IIS7 you can download an administration pack that lets you generate scripts(C#\javascript\appcmd) for IIS configuration. In IIS7.5 the administration pack is already integrated as a part of the IIS and it is called "Configuration Editor"
    You can find this on the following tutorial

    Thanks for the help you've given me before !