Hello, I have a script that deploys VMs and works fine (script available here: https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/new-vm-the-operation-is-not-supported-... ). However I have a mandatory requirement to ensure that the newly created computer goes to a specific OU and not to the default OU for newly created devices. So I need to pre-create a computer object in desired OU, which the script does, but when the vmware oscustomization kicks in with the computer join to AD it creates another computer object with same name and in wrong OU. From few investigations I see that in contexts like this, there is a need to pre-create computer objects in a different way by using the WDSUTIL ( https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc... ). So I'm checking if anybody has already done this either using the WDSUTIL or other approaches and how they integrated within the PowerCLI script... or if someone can point me to resources I can read... as so far I haven't found any
The only way I know of doing that is by using the MachineObjectOU entry in the sysprep.txt file.
The option to use a sysprep.txt file as input to an OSCustomizationSpec is currently not available (see PowerCLI Idea #143).
But you can use the CustomizationSpecsManager to create one via the API method CreateCustomizationSpec.
With the CustomizationSysprepText property, you can pass your sysprep.txt.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The only way I know of doing that is by using the MachineObjectOU entry in the sysprep.txt file.
The option to use a sysprep.txt file as input to an OSCustomizationSpec is currently not available (see PowerCLI Idea #143).
But you can use the CustomizationSpecsManager to create one via the API method CreateCustomizationSpec.
With the CustomizationSysprepText property, you can pass your sysprep.txt.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Many thanks Luc, I was afraid of that... I don't know how to handle APIs, I'll go through the material and see..
Cheers!
just in case someone is or will be in my situation I'm temporarily solving with the lines listed below. However I will definitely dig into the API solution as THAT is definitely what I need.
Cheers!