<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>IIS7 - Configuration &amp; Scripting</title><link>http://forums.iis.net/1046.aspx</link><description>Forum aimed at understanding the system.Webserver or system.ApplicationHost using a text editor or scripting</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Automating WebDav Authoring Rules</title><link>http://forums.iis.net/thread/1885414.aspx</link><pubDate>Thu, 20 Nov 2008 03:27:38 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1885414</guid><dc:creator>trnsfrmrsr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1885414.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1046&amp;PostID=1885414</wfw:commentRss><description>&lt;p&gt;With the powershell script (if you can call it that i guess so if you throw it in a file). I found the error. The access section has to have capital Read,Write,Source in it. If a rule is already there for a user it will also fail. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Shouldn&amp;#39;t make a difference, but I&amp;#39;ve been running it from the IIS powershell provider (extra install). &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Here&amp;#39;s a copy of the proper code. I just ran this one (after removing the permission it added earlier, with no issue) anyone should be able to copy and paste this into a powershell command line: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;[Reflection.Assembly]::LoadWithPartialName(&amp;quot;Microsoft.Web.Administration&amp;quot;) &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$serverManager = new-object microsoft.web.administration.servermanager&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$config = $serverManager.GetApplicationHostConfiguration()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$authoringRulesSection = $config.GetSection(&amp;quot;system.webServer/webdav/authoringRules&amp;quot;, &amp;quot;Default Web Site/site123&amp;quot;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$authoringRulesCollection = [microsoft.web.administration.ConfigurationElementCollection]&lt;br /&gt;$authoringRulesCollection = $authoringRulesSection.GetCollection()&lt;br /&gt;$addElement = [microsoft.web.administration.configurationelement]&lt;br /&gt;$addElement = $authoringRulesCollection.CreateElement(&amp;quot;add&amp;quot;)&lt;br /&gt;$addElement.setAttributeValue(&amp;quot;users&amp;quot;, &amp;quot;domain.net\user123&amp;quot;)&lt;br /&gt;$addElement.setAttributeValue(&amp;quot;path&amp;quot;, &amp;quot;*&amp;quot;)&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#the line below is the line that had to be changed&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$addElement.setAttributeValue(&amp;quot;access&amp;quot;, &amp;quot;Read,Write,Source&amp;quot;)&lt;br /&gt;$authoringRulesCollection.Add($addElement)&lt;br /&gt;$serverManager.commitChanges()&lt;br /&gt;&lt;/p&gt;&lt;/strong&gt;</description></item><item><title>Re: Automating WebDav Authoring Rules</title><link>http://forums.iis.net/thread/1885409.aspx</link><pubDate>Thu, 20 Nov 2008 00:58:29 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1885409</guid><dc:creator>trnsfrmrsr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1885409.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1046&amp;PostID=1885409</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m on server 2008 with the most recent updates. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;I just gave your command another try and it worked!!, this will certainly look (and probably work much better) than the my .net/powershell solution. &lt;/p&gt;
&lt;p&gt;can&amp;#39;t believe I didn&amp;#39;t think to use quotes around the&amp;nbsp;whole -section&amp;nbsp;option. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks for your help&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Automating WebDav Authoring Rules</title><link>http://forums.iis.net/thread/1885407.aspx</link><pubDate>Thu, 20 Nov 2008 00:45:47 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1885407</guid><dc:creator>CarlosAg</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1885407.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1046&amp;PostID=1885407</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That is interesting, are your running Windows Vista RTM? I tried this in Vista SP1 and it worked fine. (using a command prompt)&lt;/p&gt;
&lt;p&gt;I did tried it using PowerShell and it doesnt work, it turns out you need to use quotes aroung the section:&lt;/p&gt;
&lt;p&gt;.\appcmd.exe set config &amp;quot;Default Web Site/site123&amp;quot; &amp;quot;-section:system.webServer/webdav/aut&lt;br /&gt;horingRules&amp;quot; /+&amp;quot;[users=&amp;#39;domain.net\user1234&amp;#39;,path=&amp;#39;*&amp;#39;,access=&amp;#39;Read, Write, Source&amp;#39;]&amp;quot; /commit:apphost&lt;/p&gt;</description></item><item><title>Re: Automating WebDav Authoring Rules</title><link>http://forums.iis.net/thread/1885390.aspx</link><pubDate>Wed, 19 Nov 2008 21:46:51 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1885390</guid><dc:creator>trnsfrmrsr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1885390.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1046&amp;PostID=1885390</wfw:commentRss><description>&lt;p&gt;Well, this might not be the most elegant solution but I fixed it. I wanted something in powershell so I could go ahead and add this to my migration script. basically I converted the c# script generated by the admin tool.&lt;/p&gt;
&lt;p&gt;thanks everyone for your help&lt;/p&gt;
&lt;p&gt;&amp;nbsp;here it is (if anyone ever uses this, replace site123 with you site and domain.net\user123 with the user your adding): &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[Reflection.Assembly]::LoadWithPartialName(&amp;quot;Microsoft.Web.Administration&amp;quot;) &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$serverManager = new-object microsoft.web.administration.servermanager&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$config = $serverManager.GetApplicationHostConfiguration()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$authoringRulesSection = $config.GetSection(&amp;quot;system.webServer/webdav/authoringRules&amp;quot;, &amp;quot;Default Web Site/site123&amp;quot;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$authoringRulesCollection = [microsoft.web.administration.ConfigurationElementCollection]&lt;br /&gt;$authoringRulesCollection = $authoringRulesSection.GetCollection()&lt;br /&gt;$addElement = [microsoft.web.administration.configurationelement]&lt;br /&gt;$addElement = $authoringRulesCollection.CreateElement(&amp;quot;add&amp;quot;)&lt;br /&gt;$addElement.setAttributeValue(&amp;quot;users&amp;quot;, &amp;quot;domain.net\user123&amp;quot;)&lt;br /&gt;$addElement.setAttributeValue(&amp;quot;path&amp;quot;, &amp;quot;*&amp;quot;)&lt;br /&gt;$addElement.setAttributeValue(&amp;quot;access&amp;quot;, &amp;quot;read,write,source&amp;quot;)&lt;br /&gt;$authoringRulesCollection.Add($addElement)&lt;br /&gt;$serverManager.commitChanges()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Automating WebDav Authoring Rules</title><link>http://forums.iis.net/thread/1885378.aspx</link><pubDate>Wed, 19 Nov 2008 18:45:57 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1885378</guid><dc:creator>trnsfrmrsr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1885378.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1046&amp;PostID=1885378</wfw:commentRss><description>&lt;p&gt;thanks for the admin pack reccomendation I used the admin tool to generate an appcmd script, when i run the script..... &lt;/p&gt;
&lt;p&gt;appcmd.exe set config &amp;quot;Default Web Site/site123&amp;quot; -section:system.webServer/webdav/authoringRules /+&amp;quot;[users=&amp;#39;domain.net\user123&amp;#39;,path=&amp;#39;*&amp;#39;,access=&amp;#39;Read, Write, Source&amp;#39;]&amp;quot; /commit:apphost &lt;/p&gt;
&lt;p&gt;Running that command i get back: &lt;/p&gt;
&lt;p&gt;Failed to process input: The parameter &amp;#39;system.webServer/webdav/authoringRules&amp;#39; must begin with a / or - (HRESULT=80070057). I&amp;#39;m gonna take a stab here and guess that appcmd just doesn&amp;#39;t work for this.&lt;/p&gt;</description></item><item><title>Re: Automating WebDav Authoring Rules</title><link>http://forums.iis.net/thread/1885316.aspx</link><pubDate>Wed, 19 Nov 2008 06:07:40 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1885316</guid><dc:creator>CarlosAg</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1885316.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1046&amp;PostID=1885316</wfw:commentRss><description>&lt;p&gt;Could you try:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;appcmd&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;exe&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;set&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;config&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#8b0000" size="2"&gt;&lt;font color="#8b0000" size="2"&gt;&amp;quot;Default Web Site/SilverlightApp&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; -&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;section&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;:system.webServer/webdav/authoringRules /+&lt;/font&gt;&lt;font color="#8b0000" size="2"&gt;&lt;font color="#8b0000" size="2"&gt;&amp;quot;[users=&amp;#39;domain.net\user123&amp;#39;,path=&amp;#39;*&amp;#39;,access=&amp;#39;Read, Write, Source&amp;#39;]&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; /&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;commit&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;:apphost&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;I used Configuration Editor from AdminPack to generate it: &lt;a href="http://www.iis.net/extensions/AdministrationPack"&gt;http://www.iis.net/extensions/AdministrationPack&lt;/a&gt;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Automating WebDav Authoring Rules</title><link>http://forums.iis.net/thread/1885300.aspx</link><pubDate>Wed, 19 Nov 2008 00:22:43 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1885300</guid><dc:creator>trnsfrmrsr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1885300.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1046&amp;PostID=1885300</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve been playing around with all of the options you&amp;#39;ve mentioned. I seem to run into issues with actually setting or create the objects needs to set an authoring rule equal to. &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I followed the directions here to use appcmd.exe to try and set the authoring rules up &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://learn.iis.net/page.aspx/352/how-to-configure-webdav-settings-using-appcmd/"&gt;http://learn.iis.net/page.aspx/352/how-to-configure-webdav-settings-using-appcmd/&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I exectued the following command: &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;PS IIS:\Sites\Default Web Site&amp;gt; appcmd.exe set config &amp;quot;default web site/site123&amp;quot; /section:system.web.webServer/webdav/authoringRules /+[users=&amp;#39;domain.net\user123&amp;#39;,path=&amp;#39;*&amp;#39;,access=&amp;#39;Read,Write,Source&amp;#39;] /commit:apphost &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;It seems that no matter what I do I always get: &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Failed to process input: The parameter &amp;#39;path=/&amp;#39; must begin with a / or - (HRESULT=80070057). &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Is there any documentation on how to create an authoring rule? and apply it&lt;/p&gt;</description></item><item><title>Re: Automating WebDav Authoring Rules</title><link>http://forums.iis.net/thread/1885296.aspx</link><pubDate>Tue, 18 Nov 2008 23:38:14 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1885296</guid><dc:creator>anilr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1885296.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1046&amp;PostID=1885296</wfw:commentRss><description>&lt;p&gt;There are many ways to edit IIS configuration - AHAdmin, Microsoft.Web.Administration, appcmd, WMI, powershell - pick whatever works for you.&lt;/p&gt;</description></item><item><title>Automating WebDav Authoring Rules</title><link>http://forums.iis.net/thread/1885141.aspx</link><pubDate>Mon, 17 Nov 2008 23:55:12 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1885141</guid><dc:creator>trnsfrmrsr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1885141.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1046&amp;PostID=1885141</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m faced with migrating a massive file server from iis6 to iis7 (on folder for each of our users to store documents). I&amp;#39;ve figured out how to programatically migrate data, create virtual directories for each user however, I&amp;#39;m&amp;nbsp;having trouble figuring a good way to add&amp;nbsp;WebDav&amp;nbsp;authoring rules. I&amp;#39;d like to add one authoring rule per virtual directory (more secure than how were currently configured) allowing the folder owner to read, write etc. &lt;/p&gt;
&lt;p&gt;However, so far the only way i see to&amp;nbsp;programatically add authoring rules is to edit the&amp;nbsp;applicationHost.xml and throw in an XML statement for each directory. Is there a good way to go about creating authoring rules (.net class library perhaps?) or am i stuck appending authoring rules to the&amp;nbsp;applicationhost.xml configuration? &amp;nbsp;If the only good way to go about this is to append to the applicaitonhost.xml is there a best pratice method for appending to the xml file? &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>