Create folder and set ACL with web deploy
Asked Answered
Z

2

5

How do I create a folder using microsoft web deploy? Also, when I have created that folder how do I set the ACL on it?

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

Zampino answered 28/9, 2011 at 15:1 Comment(0)
R
4

If you use the contentPath or dirPath providers, the directory that you specify in the source argument will be created on the destination computer if it does not already exist. If you choose the contentPath provider, you can use its includeAcls=true setting to copy the acls over. Here's example syntax:

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

For the permissions to be set correctly, you must use domain accounts or have local accounts with matching SIDs on both the source and destination computers. For more details, see the contentPath article.

If you want to set permissions on the destination folder separately, you can use the setAcl provider. setAcl has settings like setAclUser and setAclAccess that allow for more granular control. See the article for more details, including the ins and outs of permissions.

Roughspoken answered 16/3, 2012 at 3:34 Comment(0)
F
7

A file system publish from Visual Studio will not set ACLs, but you can do it with Web Deploy. To automate the process of setting ACLs when publishing from Visual Studio or using MSBuild to publish, see this blog post:

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

Firearm answered 16/3, 2012 at 17:8 Comment(0)
R
4

If you use the contentPath or dirPath providers, the directory that you specify in the source argument will be created on the destination computer if it does not already exist. If you choose the contentPath provider, you can use its includeAcls=true setting to copy the acls over. Here's example syntax:

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

For the permissions to be set correctly, you must use domain accounts or have local accounts with matching SIDs on both the source and destination computers. For more details, see the contentPath article.

If you want to set permissions on the destination folder separately, you can use the setAcl provider. setAcl has settings like setAclUser and setAclAccess that allow for more granular control. See the article for more details, including the ins and outs of permissions.

Roughspoken answered 16/3, 2012 at 3:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.