What’s Wrong with My SysPrep Script?

0
9
Asked By TechWanderer42 On

I'm having a frustrating issue with my SysPrep script that keeps failing. The error message indicates that the package 'Microsoft.DesktopAppInstaller' was installed for a user but not provisioned for all users, causing the sysprep image to malfunction. I'm seeing the error codes 0x80073cf2 and 0x3cf2 repeatedly, and I suspect the issue might be related to the generalize flag in my script. It seems to work fine when I don't include the generalize option. I've methodically been removing AppX packages, handling user profiles, and blocking redeploy triggers, yet Sysprep still fails with that same error! Microsoft suggested some settings that didn't help. I'm running the script under audit mode with secure boot off. Can anyone spot what I might be missing or doing wrong?

5 Answers

Answered By WindowsWhiz On

I think there's an issue with how you're invoking comparison operators. For instance, in your filtering code, ensure you're using the correct boolean logic to get the intended results. You might want to use `-notlike` correctly to avoid filtering issues that could affect your script's behavior.

SyntaxMaster -

Absolutely! Using parentheses correctly can help clarify the logic and prevent unexpected results in your conditions.

Answered By CodingNinja99 On

I've experienced this too, and it often comes down to a mismatch between installed and provisioned apps. When you have an app provisioned (like version 1.0) and a user signs in who has an updated version (like 1.1), it can cause the error you're seeing. The fix is pretty straightforward: instead of removing specific apps, just remove all user-installed apps using the command `Get-AppxPackage -AllUsers | Remove-AppxPackage -AllUsers`. Users signing in afterwards will get the correct provisioned apps without any issues.

PowerShellGuru -

Definitely! That -allusers switch is key. It ensures you catch everything and resolves those mismatches.

Answered By AdminHacker732 On

You might also want to consider running your script in audit mode from the beginning. It prevents Windows from applying unnecessary updates that could interfere with Sysprep. Make sure to enter audit mode after installation, modify, install apps, and then run your script with the oobe flag. This has worked well for many in similar situations!

ScriptingPro -

That's solid advice! I missed that step myself, and it resulted in lots of headaches.

Answered By VirtualTechie On

If you're using AVD images, I've noticed the initial login can mess up Sysprep, especially with SCCM involved. Try cleaning up user profiles before you get to the Sysprep step to avoid conflicts. Also, remember that messing with inbox apps and trying to update or remove them often leads to failure as well.

Answered By CodeFixer007 On

Consider simplifying your approach. Instead of trying to remove every app, break it down into steps: first, just attempt to remove the known problematic apps. If it works, then gradually introduce complexity back in. Plus, be careful with how you're referencing attributes in your filter operations; ensure your syntax is correct, as it can lead to overlooked matches that cause issues down the line.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.