Hello everyone, I can't get to the bottom of this and I am hoping someone either knows quickly what is going on here or can point me to the correct log (the customization log in C:\windows\temp doesn't seem to include "RunOnce" information).
I think this is fairly simple but its not working. Basically I have a powershell provisioning script that does a whole slew of post build tasks...... reset the server description, fixes drive letters, resets the page file to another drive, moves the server to the correct AD OU, fixes NTFS on certain folders, addes users to the admin group, etc etc. I am trying to kick off this powershell script via a "RunOnce" during the VM deployment (within the customizations). I know the script works because if I copy my exact command from the customization to a command prompt AFTER the server is built it works fine. However, the command will not run from within the customization "RunOnce". I think ti is getting fouled up with the argument I have to pass or with the fact that I store the scripts on a network DFS location. The command is....
Powershell –ExecutionPolicy Bypass "\\MyDomain\MyDFS\MyPath\Provisioning_customization.ps1 BusinessNameArg"
- I know about VMware dropping the last quote so I tried single ticks, as well as appending two double quotes on the end.
- I tried moving the quote to the end of the ...."ps1" and leaving the argument outside the quotes.
- I also know that the RunOnce is probably trying to access the DFS UNC path using the local admin account when it logs in so I have made certain the share that houses my provisioning scripts is permissioned accordingly. Lastly as I mentioned above, the server builds correctly it just doesn't kick off my script. If I log into the newly built machine as "local admin" and run the command above word-for-word it runs perfectly without a hitch.
The reason I keep this provisioning script on the DFS share rather than on the template is because if my management or team decides we need to change our build its far easier to modify our provisioning powershell script on the DFS then to modify the template.
Any help, insight, or a pointer to where the logs are for this "RunOnce" would be greatly appreciated...... thanks in advance!!