Create Folder and Install ACL Using Web Deployment

How to create a folder using Microsoft website deployment? Also, when I created this folder, how do I set the ACL on it?

Can I do this when publishing to a file system using Visual Studio? Or do I need to publish to a server that has IIS Web Management Service (WMSvc) enabled to be able to install acl and create folders?

+4
source share
2 answers

If you use contentPath or dirPath , the directory you specify in the source argument will be created on the destination computer if it does not already exist. If you select the contentPath provider, you can use its includeAcls=true parameter to copy acls. Here is an example syntax:

 msdeploy -verb:sync -source:contentPath=c:\inetpub\wwwroot,includeAcls=true -dest:contentPath=c:\inetpub\wwwroot,computerName=Server1 

In order for the permissions to be set correctly, you must use domain accounts or have local accounts with the appropriate security identifiers on both the source and destination computers. See the contentPath article for more information.

If you want to set permissions for the target folder separately, you can use setAcl . setAcl has settings such as setAclUser and setAclAccess that allow for more granular control. See Article for more details, including permissions.

+4
source

Publishing a file system from Visual Studio will not set up an ACL, but you can do it using Web Deploy. To automate the process of setting ACLs when publishing from Visual Studio or publishing MSBuild, see this blog post:

http://sedodream.com/2011/11/08/SettingFolderPermissionsOnWebPublish.aspx

+7
source

All Articles