CaptainMatt
Contributor
Contributor

VM Customization Specifications Issues

We have a Windows Server 2022 Template that isn't applying the chosen customisation for changing the name or the VM, or adding it to the domain! It looks like this is possibly due to a delay in DHCP assigning an IP ?

I'd like to get this resolved but cant work out how unless we add a static IP in which case the result has more success,  the alternative is some sort of SYSPREP ??

 

 

5 Replies
HelloMats
Contributor
Contributor

Did you ever get this solved?
I have similar issue but I have always used a script. But if I update a template to latest patches and hardware compat the IP parameters wil not get populated to the new VM..

$IP_Params = @{
IpMode = 'UseStaticIp'
IpAddress = $IPAddress
SubnetMask = $SubnetMask
DefaultGateway = $DefaultGateway
DNS = $DNS01,$DNS02
}
Get-OSCustomizationSpec $OSCusSpec | New-OSCustomizationSpec -Name $OSTempSpec -Type NonPersistent | Out-Null
Get-OSCustomizationSpec $OSTempSpec | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping @ip_Params | Out-Null

AreWeOnline
Contributor
Contributor

We also have had this problem and as far as i see this also applies to Windows 11 Templates.

Edit: So here is how we solved our problem:

  • Tried to run sysprep.exe under C:\Windows\System32\Sysprep
  • It failed with "Sysprep was not able to validate your Windows installation. Review the log file at %windir%System32\Sysprep\Panther\setupact.log for details."
  • In the log file where some errors about edge browser and that it was installed for a user but not provisioned for all users.
  • Opened Powershell and uninstalled the package with command Get-AppxPackage | Where Name -like *Edge* | Remove-AppxPackage
  • Now Sysprep accepted to run
  • i converted the vm back to a template and the customization of the vm was no problem.

 

-> In case of the Win 11 template the packages to uninstall where three others but after removing them it also worked.

 

XtravirtTech
Contributor
Contributor

Just to add for Windows 11, I had to issue the following commands

Get-AppxPackage Microsoft.OneDriveSync | Remove-AppxPackage
Get-AppxPackage MicrosoftWindows.Client.WebExperience | Remove-AppxPackage

CaptainMatt
Contributor
Contributor

We do need to create new templates so I will keep this in mind, I have been so busy lately so forgot my thread was here!

Definitely seen this issue across a few Windows 10 and Server 2016 Upward templates!

0 Kudos
CaptainMatt
Contributor
Contributor

I wonder if it's due to windows build changes as well as the sysprep weirdness

0 Kudos