views:

78

answers:

3

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.). 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).

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.

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

A: 

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.

Haacked
A: 

@Haacked: So you're suggesting I create and copy a script to the dev environment then execute a script with the CACLS command necessary?

I need to have everything happen from the deployment system, which does not reside on the VM. And the VM is a standardized VM that gets refreshed before each deploy, so I can't make the change then save a new VM.

Ed Schwehm
+1  A: 

Another option would be to investigate using a Powershell script There are a lot powershell community snap ins to support VMs and active directory.

Active Directory Script Rescources

Powershell Script Library

Microsoft Script Resources

VMWARE VI Toolkit (for Windows)

Jason