via customization script, i am trying to do several things on new windows server 2008 r2 instances in my vcloud environments. i am launching powershell via the postcustomization call and most of what i am trying to do works, but i am having some problems and would appreciate some information and/or help.
notably, i am trying to install the microsoft distributed transaction coordinator, and that just doesn't seem to work. i have had problems with my template having dtc pre-installed and want to install it after starting up. this is something that doesn't require powershell, but i'm trying to do it from my powershell scripts that are doing a lot of other things as well.
if i just issue:
msdtc -install
i get a failure stating that msdtc can't be found (even if i specify the whole path, same thing: "The term 'C:\Windows\system32\msdtc.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."). when executing the same scripts from an interactive command prompt after the instance has started, everything succeeds. this leads me to believe that perhaps there is something related to the context under which the customization script runs that is somehow nonstandard and doesn't include the system path or something of that sort. perhaps related to the credentials under which the script executes.
i have also tried to execute my scripts via starting a new process to execute my scripts under Administrator credentials. i thought that maybe changing the context by getting it to run under a different user would help. something along the lines of (via powershell):
this also works just fine when i execute in an already running instance from a command prompt. it executes when i run it via customization script, but the artifacts created by my setup script do not appear, so i assume it just didn't execute. i've tried many variations of this with simpler commands than my script and can't get any powershell to execute this way. every time i can execute manually without any problem, but can't get it to work on creating a new instance with a customization script. this also doesn't on postcustomization but does when i'm logged in:
start-process powershell -Credential $credential -ArgumentList '-noprofile -noexit -noninteractive -Command "& {ls > C:\test.txt}"'
so my question has several parts:
1. how can i get my script to do something like install msdtc?
2. what is the context under which customization scripts run? please include information about user and anything else that makes the context unique and different than executing my script while logged in.
3. is it possible to launch a seperate process using powershell via customization script? should it work as i'm doing it? what am i doing wrong?
any information would be greatly appreciated.
dave