Windows Server 2016 sysprep failed

Sysprep for Windows Server 2016 sysprep failed for me few times, so I want to share solution with you:

Get-AppxPackage -AllUser | Remove-AppxPackage
Stop-Service -Name "tiledatamodelsvc"
Set-Service -Name "tiledatamodelsvc" -StartupType Disabled
Set-ItemProperty -Path "registry::HKLM\SYSTEM\Setup\Status\SysprepStatus" -Name "GeneralizationState" -Value 7

I hope this info will be useful for you, and if you need any help feel free to use contact form on the main page.