Perhaps this is the reason.
Fault Description
The number of network adapter settings in the customization specification does not match the number of network adapters present in the virtual machine.
Hi Z1gZa,
Have a look at the following thread if you can find a clue:
Good luck.
Regards
Franck
I've thought about that too. When I'm trying to do the following line of code it gives me another error.
cs.NicSettingMap = new CustomizationAdapterMapping[1];
"object reference not set to an instance of an object"
How can I create an array of type NicSettingMap with no range set? :smileyconfused:
My code:
CustomizationSpec cs = new CustomizationSpec();
CustomizationSysprep sysPrep = new CustomizationSysprep();
CustomizationFixedName fixedName = new CustomizationFixedName();
cs.Identity = sysPrep;
cs.GlobalIPSettings = new CustomizationGlobalIPSettings();
cs.NicSettingMap = new CustomizationAdapterMapping[1];
fixedName.Name = "xxxxxxx";
sysPrep.UserData = new CustomizationUserData();
sysPrep.UserData.FullName = "xxxx";
sysPrep.UserData.OrgName = "xxxx";
sysPrep.UserData.ComputerName = fixedName;
sysPrep.UserData.ProductId = "xxxx-xxxx-xxxx-xxxx-xxxx";
sysPrep.LicenseFilePrintData = new CustomizationLicenseFilePrintData();
sysPrep.LicenseFilePrintData.AutoMode = CustomizationLicenseDataMode.perSeat;
sysPrep.GuiUnattended = new CustomizationGuiUnattended();
sysPrep.GuiUnattended.Password = new CustomizationPassword();
sysPrep.GuiUnattended.Password.PlainText = true;
sysPrep.GuiUnattended.Password.Value = "xxxxxxxx";
sysPrep.GuiUnattended.TimeZone = xxx;
sysPrep.Identification = new CustomizationIdentification();
sysPrep.Identification.DomainAdmin = "xxxxxxxxx";
sysPrep.Identification.DomainAdminPassword = new CustomizationPassword();
sysPrep.Identification.DomainAdminPassword.Value = "xxxxxxxxx";
sysPrep.Identification.JoinDomain = "xxxxxxxx";
VM.CustomizeVM_Task(cs);
Edit: I have found a way and now I'm getting another error witch I think, it's missing IP configs.
For those who encounter this problem here is what I have done:
cs.NicSettingMap = new CustomizationAdapterMapping[] { new CustomizationAdapterMapping() };
Thank's for all your help!
Curious - would the array value not be a 0 (for the first NIC) instead of 1?
cs.NicSettingMap = new CustomizationAdapterMapping[0];
I don't think that could cause problem since it would give me an error when creating the array and not when adding other objects.
Anyway, I solved it :smileysilly:
Ah, didn't see the edit. Glad it's resolved.
I'm new with VMWARE and please help me. How can u solve this ? Thank u very much