Umbraco directory permissions | umbPermissions Script

It has bugged me since I first used Umbraco that if I was doing a manual installation I had to set the directory permissions

I just downloaded a backup of one of my clients Umbraco sites and I was setting up a copy locally and of course I had to set the directory permissions, so I thought there must be a better way!

I did a bit of Googling and had a look on the Umbraco forum but I could not find a script to perform this task, then I came across Set ACL on Source Forge and I set about writing my own little script.

Save the following script as umbpermissions.bat and save it in the same directory as Set ACL

echo off
REM Script to setup the SecurityPermissionsfor an Umbraco site
REM This script will give your machine NetworkService full rights to the appropriate directories

REM ****Pre-requisites ****
REM You will need to download -> http://setacl.sourceforge.net/

REM ****Usage****
REM You need to passin the path for the root of your Umbraco directory
REM E.g. umbPermissions.bat C:\inetpub\umbracoroot

@echo umbPermissions.bat -Script to setUmbracoFileandDirectoryPermissions
@echoPublishedbyChrisHouston-29thMay2009
@echo http://blog.vizioz.com

SetACL.exe -on "%1\web.config"-ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:full"
SetACL.exe -on "%1\bin"-ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:full"
SetACL.exe -on "%1\config"-ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:full"
SetACL.exe -on "%1\css"-ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:full"
SetACL.exe -on "%1\data"-ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:full"
SetACL.exe -on "%1\masterpages"-ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:full"
SetACL.exe -on "%1\scripts"-ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:full"
SetACL.exe -on "%1\umbraco"-ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:full"
SetACL.exe -on "%1\umbraco_client"-ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:full"
SetACL.exe -on "%1\usercontrols"-ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:full"
SetACL.exe -on "%1\xslt"-ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:full"

Feel free to comment if I missed anything!


Author

Chris Houston

Chris is the founder of Vizioz and has been working in the field of website development for over 20 years. Chris has been working with Umbraco since 1998 and now spends his time running both Vizioz and QV Offices.


comments powered by Disqus