<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Footprints in the snow of a warped mind - PowerShell</title>
    <link>http://blogs.thesitedoctor.co.uk/test/</link>
    <description>newtelligence powered</description>
    <language>en-us</language>
    <copyright>Tim</copyright>
    <lastBuildDate>Thu, 17 Jun 2010 13:47:22 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>timgaunt@gmail.com</managingEditor>
    <webMaster>timgaunt@gmail.com</webMaster>
    <item>
      <trackback:ping>http://blogs.thesitedoctor.co.uk/test/Trackback.aspx?guid=646bc72f-3ad7-42c4-904b-dc18c1eff695</trackback:ping>
      <pingback:server>http://blogs.thesitedoctor.co.uk/test/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.thesitedoctor.co.uk/test/PermaLink,guid,646bc72f-3ad7-42c4-904b-dc18c1eff695.aspx</pingback:target>
      <dc:creator>Tim</dc:creator>
      <wfw:comment>http://blogs.thesitedoctor.co.uk/test/CommentView,guid,646bc72f-3ad7-42c4-904b-dc18c1eff695.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.thesitedoctor.co.uk/test/SyndicationService.asmx/GetEntryCommentsRss?guid=646bc72f-3ad7-42c4-904b-dc18c1eff695</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="powershell2xa4[1]" border="0" alt="powershell2xa4[1]" align="right" src="http://blogs.thesitedoctor.co.uk/tim/images/SetUmbracoFolderPermissionswithPowershel_C08E/powershell2xa41.jpg" width="260" height="208" /> If
you're not configuring Umbraco through a web installer, you've had your installs in
place for years and never checked the permissions or whoever set the permissions up
was lazy and gave IIS write access to the entire folder, there will come a time when
you want to restrict modify access to just those user(s) who should have access.
</p>
        <p>
You can find a (pretty) complete <a href="http://umbraco.org/documentation/books/important-files-and-folder-structure/permissions">list
of the files/folders that the Umbraco install should have access to here</a> but assigning
them across 101 different installs is a 
<abbr title="Pain In The Ass">
PITA
</abbr>
. Thanks to a <a href="http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/">helpful
PowerShell script to set folder permissions from PowerShell.nu</a> you can easily
automate the process.
</p>
        <p>
For those of you not familiar with PowerShell (like me) complete instructions are
below. For the rest, here's the command: 
</p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:6204aace-8f3a-49eb-928d-e0c33f5a299b" class="wlWriterEditableSmartContent">
          <pre class="brush: powershell;">Get-ChildItem -path ##PATH TO YOUR INSTALL## 
| Where { $_.name -eq "Bin" -or $_.name -eq "Config" -or $_.name -eq "Css" -or $_.name -eq "Data" -or $_.name -eq "Masterpages" -or $_.name -eq "Media" -or $_.name -eq "Scripts" -or $_.name -eq "Umbraco" -or $_.name -eq "Umbraco_client" -or $_.name -eq "UserControls" -or $_.name -eq "Xslt" } 
| ForEach {./SetFolderPermission.ps1 -path $_.Fullname -Access "NETWORK SERVICE" -Permission Modify}
</pre>
        </div>
        <p>
 
</p>
        <p>
          <strong>Instructions:</strong>
        </p>
        <ol>
          <li>
Save the <a href="http://blogs.thesitedoctor.co.uk/tim/files/setfolderpermission.ps1.txt">SetFolderPermission.ps1
script</a> to your server 
</li>
          <li>
Open your PowerShell console (I think it's installed by default if not, you can <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx">download
PowerShell here</a>) 
</li>
          <li>
Copy the above PowerShell command into notepad 
</li>
          <li>
Update "##PATH TO YOUR INSTALL##" to your Umbraco install 
</li>
          <li>
If your IIS install doesn't use NETWORK SERVICE as the default user, update it to
your user 
</li>
          <li>
Make sure it's all on a single line 
</li>
          <li>
Copy/Paste/Run in PowerShell 
</li>
        </ol>
        <p>
          <strong>Bonus</strong>
        </p>
        <p>
If you're uber lazy and just have a web folder of Umbraco installs you can set the
path to the folder of Umbraco installs and use:
</p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:759a61db-2bc9-456c-9e1b-240acdea1c26" class="wlWriterEditableSmartContent">
          <pre class="brush: text;">Get-ChildItem -path ##PATH TO YOUR FOLDER## -recurse
| Where { $_.name -eq "Bin" -or $_.name -eq "Config" -or $_.name -eq "Css" -or $_.name -eq "Data" -or $_.name -eq "Masterpages" -or $_.name -eq "Media" -or $_.name -eq "Scripts" -or $_.name -eq "Umbraco" -or $_.name -eq "Umbraco_client" -or $_.name -eq "UserControls" -or $_.name -eq "Xslt" } 
| ForEach {./SetFolderPermission.ps1 -path $_.Fullname -Access "NETWORK SERVICE" -Permission Modify}
</pre>
        </div>
        <p>
 
</p>
        <p>
I've not tried this mind you and can't recommend it but hey, it's there if you want
it ;)
</p>
        <img width="0" height="0" src="http://blogs.thesitedoctor.co.uk/test/aggbug.ashx?id=646bc72f-3ad7-42c4-904b-dc18c1eff695" />
      </body>
      <title>Set Umbraco Folder Permissions with Powershell</title>
      <guid isPermaLink="false">http://blogs.thesitedoctor.co.uk/test/PermaLink,guid,646bc72f-3ad7-42c4-904b-dc18c1eff695.aspx</guid>
      <link>http://blogs.thesitedoctor.co.uk/test/2010/06/17/SetUmbracoFolderPermissionsWithPowershell.aspx</link>
      <pubDate>Thu, 17 Jun 2010 13:47:22 GMT</pubDate>
      <description>&lt;p&gt;
&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="powershell2xa4[1]" border="0" alt="powershell2xa4[1]" align="right" src="http://blogs.thesitedoctor.co.uk/tim/images/SetUmbracoFolderPermissionswithPowershel_C08E/powershell2xa41.jpg" width="260" height="208" /&gt; If
you're not configuring Umbraco through a web installer, you've had your installs in
place for years and never checked the permissions or whoever set the permissions up
was lazy and gave IIS write access to the entire folder, there will come a time when
you want to restrict modify access to just those user(s) who should have access.
&lt;/p&gt;
&lt;p&gt;
You can find a (pretty) complete &lt;a href="http://umbraco.org/documentation/books/important-files-and-folder-structure/permissions"&gt;list
of the files/folders that the Umbraco install should have access to here&lt;/a&gt; but assigning
them across 101 different installs is a 
&lt;abbr title="Pain In The Ass"&gt;
PITA
&lt;/abbr&gt;
. Thanks to a &lt;a href="http://www.powershell.nu/2009/02/13/set-folder-permissions-using-a-powershell-script/"&gt;helpful
PowerShell script to set folder permissions from PowerShell.nu&lt;/a&gt; you can easily
automate the process.
&lt;/p&gt;
&lt;p&gt;
For those of you not familiar with PowerShell (like me) complete instructions are
below. For the rest, here's the command: 
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:6204aace-8f3a-49eb-928d-e0c33f5a299b" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: powershell;"&gt;Get-ChildItem -path ##PATH TO YOUR INSTALL## 
| Where { $_.name -eq "Bin" -or $_.name -eq "Config" -or $_.name -eq "Css" -or $_.name -eq "Data" -or $_.name -eq "Masterpages" -or $_.name -eq "Media" -or $_.name -eq "Scripts" -or $_.name -eq "Umbraco" -or $_.name -eq "Umbraco_client" -or $_.name -eq "UserControls" -or $_.name -eq "Xslt" } 
| ForEach {./SetFolderPermission.ps1 -path $_.Fullname -Access "NETWORK SERVICE" -Permission Modify}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Instructions:&lt;/strong&gt;
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Save the &lt;a href="http://blogs.thesitedoctor.co.uk/tim/files/setfolderpermission.ps1.txt"&gt;SetFolderPermission.ps1
script&lt;/a&gt; to your server 
&lt;/li&gt;
&lt;li&gt;
Open your PowerShell console (I think it's installed by default if not, you can &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx"&gt;download
PowerShell here&lt;/a&gt;) 
&lt;/li&gt;
&lt;li&gt;
Copy the above PowerShell command into notepad 
&lt;/li&gt;
&lt;li&gt;
Update "##PATH TO YOUR INSTALL##" to your Umbraco install 
&lt;/li&gt;
&lt;li&gt;
If your IIS install doesn't use NETWORK SERVICE as the default user, update it to
your user 
&lt;/li&gt;
&lt;li&gt;
Make sure it's all on a single line 
&lt;/li&gt;
&lt;li&gt;
Copy/Paste/Run in PowerShell 
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Bonus&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
If you're uber lazy and just have a web folder of Umbraco installs you can set the
path to the folder of Umbraco installs and use:
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:759a61db-2bc9-456c-9e1b-240acdea1c26" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: text;"&gt;Get-ChildItem -path ##PATH TO YOUR FOLDER## -recurse
| Where { $_.name -eq "Bin" -or $_.name -eq "Config" -or $_.name -eq "Css" -or $_.name -eq "Data" -or $_.name -eq "Masterpages" -or $_.name -eq "Media" -or $_.name -eq "Scripts" -or $_.name -eq "Umbraco" -or $_.name -eq "Umbraco_client" -or $_.name -eq "UserControls" -or $_.name -eq "Xslt" } 
| ForEach {./SetFolderPermission.ps1 -path $_.Fullname -Access "NETWORK SERVICE" -Permission Modify}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
I've not tried this mind you and can't recommend it but hey, it's there if you want
it ;)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.thesitedoctor.co.uk/test/aggbug.ashx?id=646bc72f-3ad7-42c4-904b-dc18c1eff695" /&gt;</description>
      <comments>http://blogs.thesitedoctor.co.uk/test/CommentView,guid,646bc72f-3ad7-42c4-904b-dc18c1eff695.aspx</comments>
      <category>ASP.Net</category>
      <category>Hosting</category>
      <category>IIS</category>
      <category>PowerShell</category>
      <category>Server Maintenance</category>
      <category>Server Management</category>
      <category>Umbraco</category>
      <category>Web Development</category>
    </item>
    <item>
      <trackback:ping>http://blogs.thesitedoctor.co.uk/test/Trackback.aspx?guid=ad7d4d9d-0eff-41e7-bf10-536642366b29</trackback:ping>
      <pingback:server>http://blogs.thesitedoctor.co.uk/test/pingback.aspx</pingback:server>
      <pingback:target>http://blogs.thesitedoctor.co.uk/test/PermaLink,guid,ad7d4d9d-0eff-41e7-bf10-536642366b29.aspx</pingback:target>
      <dc:creator>Tim</dc:creator>
      <wfw:comment>http://blogs.thesitedoctor.co.uk/test/CommentView,guid,ad7d4d9d-0eff-41e7-bf10-536642366b29.aspx</wfw:comment>
      <wfw:commentRss>http://blogs.thesitedoctor.co.uk/test/SyndicationService.asmx/GetEntryCommentsRss?guid=ad7d4d9d-0eff-41e7-bf10-536642366b29</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've been re-working our new SVN structures recently as I'm now starting to understand
how it works but one of the issues I had was trying to move the files/folders from
a previous SVN directory.
</p>
        <p>
PowerShell is great if you understand it (which I'm also learning) so I thought I
would share this little script with you. It just loops through the files/folders and
removes all those named _svn. I found <a href="http://renaissauce.com/thoughts/powershell-vs-command-prompt-on-deleting-svn-directories/">this
script from Wyatt Lyon Preul</a> and he complained about the length of the script,
but from what I can tell you can condense that down to:
</p>
        <div class="code">gci $folder -fil '_svn' -r -fo | ? {$_.psIsContainer} | ri -fo -r
</div>
        <p>
I'm not that great with PowerShell yet but I hope that helps someone :)
</p>
        <strong>WARNING: </strong>As ever, incase I'm wrong (it happens!) test that on a folder
first that you don't worry about losing!<img width="0" height="0" src="http://blogs.thesitedoctor.co.uk/test/aggbug.ashx?id=ad7d4d9d-0eff-41e7-bf10-536642366b29" /></body>
      <title>Deleting SVN directories with PowerShell</title>
      <guid isPermaLink="false">http://blogs.thesitedoctor.co.uk/test/PermaLink,guid,ad7d4d9d-0eff-41e7-bf10-536642366b29.aspx</guid>
      <link>http://blogs.thesitedoctor.co.uk/test/2008/07/05/DeletingSVNDirectoriesWithPowerShell.aspx</link>
      <pubDate>Sat, 05 Jul 2008 15:25:32 GMT</pubDate>
      <description>&lt;p&gt;
I've been re-working our new SVN structures recently as I'm now starting to understand
how it works but one of the issues I had was trying to move the files/folders from
a previous SVN directory.
&lt;/p&gt;
&lt;p&gt;
PowerShell is great if you understand it (which I'm also learning) so I thought I
would share this little script with you. It just loops through the files/folders and
removes all those named _svn. I found &lt;a href="http://renaissauce.com/thoughts/powershell-vs-command-prompt-on-deleting-svn-directories/"&gt;this
script from Wyatt Lyon Preul&lt;/a&gt; and he complained about the length of the script,
but from what I can tell you can condense that down to:
&lt;/p&gt;
&lt;div class="code"&gt;gci $folder -fil '_svn' -r -fo | ? {$_.psIsContainer} | ri -fo -r
&lt;/div&gt;
&lt;p&gt;
I'm not that great with PowerShell yet but I hope that helps someone :)
&lt;/p&gt;
&lt;strong&gt;WARNING: &lt;/strong&gt;As ever, incase I'm wrong (it happens!) test that on a folder
first that you don't worry about losing!&lt;img width="0" height="0" src="http://blogs.thesitedoctor.co.uk/test/aggbug.ashx?id=ad7d4d9d-0eff-41e7-bf10-536642366b29" /&gt;</description>
      <comments>http://blogs.thesitedoctor.co.uk/test/CommentView,guid,ad7d4d9d-0eff-41e7-bf10-536642366b29.aspx</comments>
      <category>PowerShell</category>
      <category>Server Maintenance</category>
      <category>Server Management</category>
      <category>The Site Doctor</category>
      <category>Web Development</category>
    </item>
  </channel>
</rss>