Deployment mit Powershell – Schritt 4: Benutzerrechte von Ordnern setzen.

by robert 8. May 2009 21:20

Für eine Reihe von Ordnern benötigt der IIS User Schreibrechte. Hierfür verwenden wir eine Datei “user-rights.template”, die die entsprechenden Rechte erhält.

5-8-2009 9-14-15 PM

Folgende Ordner in unserer deployten Webseite sollen diese Rechte erhalten: "ProductImages", "PunchOutImages", "Style", "TempFiles", "CmsImages".

Nun hilft diese Funktion:

   1: function SetFolderUserRights
   2: {
   3:     $folderNames = "ProductImages", "PunchOutImages", "Style", "TempFiles", "CmsImages" 
   4:     
   5:     $templateAcl = Get-Acl ($path_sourceRoot + "/user-rights.template")
   6:     
   7:     foreach($folderName in $folderNames){
   8:         Set-Acl -Path ($path_targetDeployment + "/" + $folderName) -AclObject $templateAcl
   9:     }    
  10: }

Im nächsten Schritt gilt es, die IIS Web-Application mit Powershell einzurichten: 

5-8-2009 9-17-26 PM

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About Oliver

shades-of-orange.com code blog logo I build web applications using ASP.NET and have a passion for javascript. Enjoy MVC 4 and Orchard CMS, and I do TDD whenever I can. I like clean code. Love to spend time with my wife and our children. My profile on Stack Exchange, a network of free, community-driven Q&A sites

About Anton

shades-of-orange.com code blog logo I'm a software developer at teamaton. I code in C# and work with MVC, Orchard, SpecFlow, Coypu and NHibernate. I enjoy beach volleyball, board games and Coke.