1. Per default our deployment puts all our new servers in the default OU in our AD. I have found it very difficult to move the computer account from one OU to another. I have used dsmove.exe and the vCenter build in Customization Spec with no luck.
Can I use Invoke-VMScript in our deployment script to execute this move? We join our member servers using the Customization spec as well. But maybe it work best to use the script there as well.....
the best solution would be to be promted like:
Join Domain? Yes ---> Code to join domain No----> Workgroup
If Yes....the scripts creates or moves the computer accout to our "Deployment OU"
2. I also would like to install our OP5 monitoring agent in this script. Is this possible?
I have a msiexec string I would like to use:
msiexec.exe /quiet /i "%~dp0NSCP-0.5.2.35-x64.msi" /norestart MONITORING_TOOL=OP5 CONF_CAN_CHANGE=1 NSCLIENT_PWD="password" ALLOWED_HOSTS="ip"
3. I also would like to add an user interaction where I can choose what Network to deploy the VMs.
I have attached my deployment script.....
You can use the Invoke-VMScript for the first 1, but there are a couple of caveats.
The network selection (your 3th point) can be prompted and set with the New-VM or Set-VM cmdlet.
It has nothing to do with the Guest OS, but assigns the VM to a specific Portgroup.
Setting the network settings inside the Guest OS, IP address/network mask/gateway..., can be done through the OSCustimozationSpec.
For that, you use the New-OSCustomizationNicMapping or Set-OSCustomizationNIcMapping cmdlets.
There is a great set of blog post on the use of OSCustomizationSpec.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference