Giter Site home page Giter Site logo

davidgeeraerts / module_system_sysprep Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1.01 MB

Mostly automated processing of SysPrep

License: GNU General Public License v3.0

Batchfile 100.00%
sysprep administrator cleanmgr cli windows-10 windows10 cmd cmdline batch batch-script

module_system_sysprep's Introduction

Logo generated using Midjourney Image Generator

🔃 module_system_SysPrep

📃 Description

Automated processing of SysPrep. Likes to be on a [USB] flash drive; can run from other local storage. Log files will be stored where the program was executed from.

⬇️ Download

Can download just the commandlet: Download --right-click and "Save Link as..."

✅ Process List

0️⃣0️⃣ Flush logged on user --usually the default user.

0️⃣1️⃣ Administrator, local configuration

0️⃣2️⃣ Users, cleanup local users

0️⃣3️⃣ Scheduled Task, cleanup

0️⃣4️⃣ Windows Update

0️⃣5️⃣ Disk Check, for dirty bit

0️⃣6️⃣ CleanMgr, run disk cleanup

0️⃣7️⃣ Bitlocker check

0️⃣8️⃣ Final reboot, in preparation for running SysPrep

0️⃣9️⃣ Windows APPX Packages

1️⃣0️⃣ SysPrep

📗 Instructions

Best practice is to use external storage such as a USB Flash drive.

  • Manually run module_system_SysPrep with administrative privilege
    • Pass the config file name as a parameter.
    • default module_system_SysPrep.properties
  • First run will configure the local administrator and log out current user, which should be the unattend.xml first logon user.
  • Log in with local Administrator account --no password
  • CleanMgr will prompt if SAGE 100 is not set
  • Final Reboot will reboot and auto-login Administrator
  • Manually run module_system_SysPrep with admin privilege for the final SysPrep run.

📙 Dependencies

  • Delprof2
    • Useful tool that does a complete job. Better than Powershell:
    • Get-CimInstance -Class Win32_UserProfile | Where-Object { $_.LocalPath.split('\')[-1] -eq 'UserA' } | Remove-CimInstance
      • which leaves the user account on the system!

📨 Passing Config file as Paramter

  • Open shell/terminal with administrative privilege
  • cd /D to module directory where module_system_SysPrep.cmd
  • Pass config file name if not the default module_system_SysPrep.properties
  • Can have different properties files for different systems, then just pass the [custom] properties file as a parameter.

Example:

  • module_system_SysPrep.cmd Custom.config
📓 Notes (recent to old)

module_system_sysprep's People

Contributors

davidgeeraerts avatar

Stargazers

 avatar

Watchers

 avatar  avatar

module_system_sysprep's Issues

Windows APPX Package for OneDrive fails to catch entire sting

From sysprep log:
2022-06-24 10:35:14, Error SYSPRP Package Microsoft.OneDriveSync_21220.1024.5.0_neutral__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.

Setting the package variable only caught: Microsoft.OneDriveSync_21220.1024.5.0_neutral__8w

10:21:43.96 [DEBUG] $PACKAGE_NAME: Microsoft.OneDriveSync_21220.1024.5.0_neutral__8w

Questions about module

@Carm01

No worries, appreciate you reaching out when you have the time (or interest).
Yes, module_system_SysPrep is a script/program to automate Windows SysPrep. Part of my job is a lab manager, so I maintain images, which means I sysprep at least once a week for image maintenance.
I'm using the Ansible naming convention. I don't want to use Ansible since there's something about --at least with Windows-- to want to keep it native and not add dependencies, in this case, Python with Ansible.
Appreciate you sharing the link to Dism++, that looks really cool and useful. That's something I'll take a close look at for another module I maintain, module_system_Windows_Lilliputian, it's still in alpha. So far I'm getting Windows 10 2004 down to 14GB without severe feature limitation.
Unattend.xml is an option:
There are times I want to run Sysprep with unattend, and other times not. Also, sometimes I want to keep the unattend cache, and other times I want to nuke any unattend information from the image --let's say if I want to keep a pure image, which I call Base image.
As for user profile, that's up to the person running sysprep. For image maintenance, a default user is usually used. That default user sometimes needs to be nuked, so the first parameter $CUSTOM_USER allows nuking the default user used in unattend. Obviously that needs to be clearer in the documentation.

Hope you ask me more questions so maybe I can make this module useful ;-)

Shadow Copies (Check and Delete)

Check and delete shadow copies:
vssadmin delete shadows /All /Quiet
vssadmin resize shadowstorage /for=%SystemDrive% /on=%SystemDrive% /maxsize=unbounded

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.