<?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>Search results matching tag 'powershell microsoft.web.administration authoringRules authoring rule'</title><link>http://forums.iis.net/search/SearchResults.aspx?o=DateDescending&amp;tag=powershell+microsoft.web.administration+authoringRules+authoring+rule&amp;orTags=0</link><description>Search results matching tag 'powershell microsoft.web.administration authoringRules authoring rule'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Automating WebDav Authoring Rules</title><link>http://forums.iis.net/p/1153161/1885414.aspx#1885414</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><cs:applicationKey>iis7_-_configuration__scripting-41</cs:applicationKey><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></channel></rss>