<p>We have a deployment system at my office where we can automatically deploy a given build of our code to a specified dev environment (dev01, dev02, etc.). </p>

<p>These dev environments are generalized virtual machines, so our system has to configure them automatically. We have a new system requirement with our next version; we need to give certain user accounts read/write access to certain folders (specifically, giving the ASPNET user read/write to a logging folder). </p>

<p>I'm pretty sure we could do this with WMI or scripts (we use Sysinternals PSTools in a few places for deployment), but I'm not sure what is the best way to do it. The deployment system is written in C# 2.0, the dev environment is a VM with Windows XP. The VM is on the same domain as the deployment system and I have administrator access.</p>

<p>Edit: There's not really a right answer for this, so I'm hesitant to mark an answer as accepted.</p>

[{'answer_id': 46218, 'author': 'Haacked', 'author_id': 598, 'author_profile': 'https://Stackoverflow.com/users/598', 'pm_score': 0, 'selected': False, 'text': '<p>If you can run scripts, it might be as simple as runing the CACLS command on the VM. Perhaps just have your deployment script read in a config and run the appropriate CACLs commands.</p>\n'}, {'answer_id': 46511, 'author': 'Jason Von Ruden', 'author_id': 2062, 'author_profile': 'https://Stackoverflow.com/users/2062', 'pm_score': 2, 'selected': True, 'text': '<p>Another option would be to investigate using a Powershell script There are a lot powershell community snap ins to support VMs and active directory.</p>\n\n<p><a href="http://www.computerperformance.co.uk/powershell/powershell_active_directory.htm#ADUC_(Active_Directory_Users_and_Computers)_" rel="nofollow noreferrer">Active Directory Script Rescources</a></p>\n\n<p><a href="http://www.myitforum.com/myITWiki/Default.aspx?Page=WPScripts&amp;AspxAutoDetectCookieSupport=1" rel="nofollow noreferrer">Powershell Script Library</a></p>\n\n<p><a href="http://www.microsoft.com/technet/scriptcenter/scripts/msh/ad/default.mspx?mfr=true" rel="nofollow noreferrer">Microsoft Script Resources</a></p>\n\n<p><a href="http://blogs.vmware.com/vipowershell/" rel="nofollow noreferrer">VMWARE VI Toolkit (for Windows)</a></p>\n'}]
['https://Stackoverflow.com/questions/46173', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1206/']