TWiki
>
CF Web
>
Windows
>
WindowsInCS
>
InitialWindowsInstall
>
SysPrep
(2020-05-28,
MikeGore
)
(raw view)
E
dit
A
ttach
-- Main.MikeGore - 15 Nov 2010 ---+ SysPrep %TOC% ---++ Windows 10 * *We assume you have a fully loaded version of windows and it has been activated* ---++ Activation * https://cs.uwaterloo.ca/twiki/view/CF/WindowsActivation ---+++ Reference If you want to use MS deployment tools * *Note - we do NOT follow those steps here - as we are only using sysprep and none of the deployment tools in this example* * If you want to see how Microsoft recommends setting up windows 10 with their deployment tools see this link * * https://technet.microsoft.com/en-us/library/mt297533%28v=vs.85%29.aspx * http://deploymentresearch.com/Research/Post/496/Building-a-Windows-10-Reference-Image-using-MDT-2013-Update-1 ---+++ Registry Fixes * Open regedit as Administrator (right click run as admin) * Delete this registry tree: *HKEY_LOCAL_MACHINE\SYSTEM\Setup\Upgrade* * Verify *HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\CleanupState* = 7 * As and Admin User in CMD prompt run: *slmgr /dli* * Note: Windows should still be activated at this point if you already activated it earlier * *Reboot!* ---+++ Remove provisioned (built-in) apps in Windows 10 * References: * https://4sysops.com/archives/remove-provisioned-built-in-apps-in-windows-10/#installed-vs-provisioned-apps * https://support.microsoft.com/en-us/kb/2769827 * *NOTE: You can not have updated Apps - or provisioned Apps in an image* * Unfortunately this will happen Automatically just by being connected to the Internet. * *So we have to remove them!* * *You MUST disable network interface on the computer or VM during this process* * Or at least have some kind of firewall that blocks external access - otherwise the apps will update an break things * Allow Powershell to execute scripts * Open Command Prompt as Administrator and run: * *powershell.exe -command set-executionpolicy unrestricted* * Start PowerShell as Administrator * Download and run this powershell script: [[%PUBURLPATH%/%WEB%/%TOPIC%/Removeapps1.ps1][Removeapps1.ps1]] * Run this powershell command and verify the list is empty: *Get-AppXProvisionedPackage -Online | Select PackageName* * If this list is not empty seeing the section below for instructions on updating the script. * *Restore Powershell to original execute policy* * Open Command Prompt as Administrator and run: * *powershell.exe -command set-executionpolicy restricted* ---++++ How to update the powershell script to remove additional apps * To get a list of the provisioned apps * *Get-AppXProvisionedPackage -Online | Select PackageName* * *Note: the real package name is the string prior to the first underscore '_'* * *Example Package Name: Microsoft.3DBuilder* * So we ignore the *_2015.624.2254.0_neutral_~_8wekyb3d8bbwe* trailing part * Extract the names from the above command and add them - if required - to the following script: * [[%PUBURLPATH%/%WEB%/%TOPIC%/Removeapps1.ps1][Here is a link to the file]] * Note: it does not matter if you list a program that does not exist - it will ignore it * Save the script as *Removeapps1.ps1* ---+++ Script Removeapps1.ps1 for reference <verbatim> Import-Module Appx Import-Module Dism $AppsList = "Microsoft.Appconnector","Microsoft.CommsPhone","Microsoft.ConnectivityStore","Microsoft.Messaging","Microsoft.Office.OneNote","Microsoft.Office.Sway","Microsoft.WindowsAlarms","Microsoft.WindowsCalculator","Microsoft.WindowsCamera","Microsoft.WindowsPhone","Microsoft.WindowsSoundRecorder","Microsoft.WindowsStore", "Microsoft.BingFinance","Microsoft.BingNews","Microsoft.BingWeather","Microsoft.XboxApp","Microsoft.SkypeApp","Microsoft.MicrosoftSolitaireCollection","Microsoft.BingSports","Microsoft.ZuneMusic","Microsoft.ZuneVideo","Microsoft.Windows.Photos","Microsoft.People","Microsoft.MicrosoftOfficeHub","Microsoft.WindowsMaps","microsoft.windowscommunicationsapps","Microsoft.Getstarted","Microsoft.3DBuilder" ForEach ($App in $AppsList) { $PackageFullName = (Get-AppxPackage $App).PackageFullName $ProPackageFullName = (Get-AppxProvisionedPackage -online | where {$_.Displayname -eq $App}).PackageName write-host $PackageFullName Write-Host $ProPackageFullName if ($PackageFullName) { Write-Host "Removing Package: $App" remove-AppxPackage -package $PackageFullName } else { Write-Host "Unable to find package: $App" } if ($ProPackageFullName) { Write-Host "Removing Provisioned Package: $ProPackageFullName" Remove-AppxProvisionedPackage -online -packagename $ProPackageFullName } else { Write-Host "Unable to find provisioned package: $App" } } </verbatim> ---+++ List Apps from a specific vendor * This may be of interest if you ever want to list packages from just one vendor * Example: Microsoft Packages (they have the code 8wekyb3d8bbwe ) * *Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe | Format-List -Property PackageFullName,PackageUserInformation* ---+++ sysprep * Run sysprep with Generalize and Shutdown ---++ Windows 7 ---+++ External Documents * http://www.symantec.com/connect/blogs/windows7-untangling-scripted-installs-sysprep-and-configuration-passes * http://technet.microsoft.com/en-us/library/dd744366%28v=ws.10%29.aspx - How Windows Setup Works * http://technet.microsoft.com/en-us/library/dd744512%28WS.10%29.aspx - How Sysprep Works * http://technet.microsoft.com/en-us/library/dd744341%28v=ws.10%29.aspx - How Configuration Passes Work * http://technet.microsoft.com/en-us/library/ff699026.aspx - Unattended Answer File ---+++ Options * Command Line syntax: http://technet.microsoft.com/en-us/library/dd744330%28v=ws.10%29.aspx * Typical Usage: * *sysprep.exe /shutdown /oobe /generalize /unattened:file.xml* * * */generalize* cleans out device specific information during sysprep * See: http://technet.microsoft.com/en-us/library/dd744392%28v=ws.10%29.aspx * */unattend:* the answer file for unattened operation * See: http://technet.microsoft.com/en-us/library/ff699026.aspx * */oobe* out of box experience * See: configuration pass configures settings that are applied during the end-user first-boot experience, also called Windows Welcome. The oobeSystem configuration pass settings are processed before a user first logs on to Windows ---+++ How to keep drivers when syspreping * See: http://technet.microsoft.com/en-us/library/ee832798%28v=ws.10%29.aspx - Maintain Driver Configurations When Capturing a Windows Image * Answer file updates </verbatim> <settings pass="generalize"> <component name="Microsoft-Windows-PnpSysprep"> <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls> </component> </verbatim> * Another way would be to configure the registry key: * *HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Sysprep\Settings\sppnp\PersistAllDeviceInstalls = 1* ---+++ Fix Sysprep 3 times limit 1 * Here is how to reset the 3 limit is sysprep in windows 7 * Reference: * htttp://www.system-center.me/miscellaneous/sysprep-your-windows-os-for-more-then-3-times/ * http://massiveflavor.com/2013/04/08/sysprep-fatal-error-bypassing-the-rearm-limit/ 1 * Open administrative command prompt - we need to check the rearm counter * *slmgr.vbs /dlv* * If the result is zero you need to make the following registry updates - step (3) 1 * Use *regedit* * HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SoftwareProtectionPlatform\SkipRearm = 1 * Note that the image does not retain this SkipDisarm value - it gets reset after doing the sysprep * HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\CleanupState = 2 * HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState = 7 1 * *slmgr.vbs -rearm* 1 * *msdtc -uninstall* * wait 5 seconds * *msdtc -install* * wait 5 seconds * Restart the computer 1 * When the machine is booted back up (it should still be in Sysprep audit mode) * Check the 3 registry keys again to confirm the values are the same. If not, change them to match the 2, 7, and 1 as detailed earlier in step 3. 1 * Delete the Panther folder 1 * *sysprep will now works!* ---+++ Moving a machine image into a Virtual Machine * See: https://www.virtualbox.org/wiki/Migrate_Windows - How to migrate existing Windows installations to VirtualBox ---++ Clean Up Steps 1 Disable and Re-enable System Restore - to empty the System Volume Backups Data - this can be BIG - you do not have to reboot! 1 Delete any archival update/patch directories in the c:\windows directory. 1 Clear all Internet cache files, cookies, and temp. files. 1 Delete any files in temp directories. 1 Clear all Event Viewer logs. 1 Empty Recycle bin. 1 Change network settings so TCP/IP settings use DHCP not static addres ---++ Sysprep Process * To sysprep use the following options */oobe* */generalize* */shutdown* ---++ Debugging errors * *c:\windows\panther\unattendgc* has log files if the sysprep hangs - boot the RIP image and look at the logs ---++ Windows XP ---+++ Common Clean Up Steps 1 Disable and renable System Restore - to empty the System Volume Backups Data - this can be BIG - you do not have to reboot! 1 Delete any archival update/patch directories in the c:\windows directory. 1 Clear all Internet cache files, cookies, and temp. files. 1 Delete any files in temp directories. 1 Clear all Event Viewer logs. 1 Empty Recycle bin. 1 Change network settings so TCP/IP settings use DHCP not static address. ---+++ Sysprep Process 1 Copy CSCF sysprep to \sysprep * Research Sysprep: //asimov:/images/sysprep/sysprep.zip * unzip into the root directory * Core: //asimov:/coregroup1/images/sysprep/Core * (now look for latest sysprep directory. ie sysprep sept09/sysprep-Aug2009/sysprep - Note: NOT ZIPPED) 1 CD \sysprep * Edit *sysprep.inf* and make any changes you need - normally only need to add an extra drivers entry) 1 run *sysprep.exe* - use mini setup option and select RESEAL 1 Restart the PC with a *[[CF.RIP][RIP]] + GHOST* CD - or *PXE* boot on Vlan *420* * //asimov:/images/rawiso/linux_utils/RIP/RIP11.0/RIPLinuX-11.0.iso * Note: CF.RIP has been modified by the CSCF Research Group 1 Read over CF.ImageDeploymentGhost
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
ps1
Removeapps1.ps1
r2
r1
manage
1.6 K
2016-07-24 - 21:58
MikeGore
Remove Provisioned Apps
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r12
<
r11
<
r10
<
r9
<
r8
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r12 - 2020-05-28
-
MikeGore
CF
Information in this area is meant for use by CSCF staff and is not official documentation, but anybody who is interested is welcome to use it if they find it useful.
CF Web
CF Web Home
Changes
Index
Search
Administration
Communication
Email
Hardware
HelpDeskGuide
Infrastructure
InternalProjects
Linux
MachineNotes
Macintosh
Management
Networking
Printing
Research
Security
Software
Solaris
StaffStuff
TaskGroups
TermGoals
Teaching
UserSupport
Vendors
Windows
XHier
Other Webs
CSEveryBody
Main
Sandbox
TWiki
UW
My links
People
CERAS
WatForm
Tetherless lab
Ubuntu Main.HowTo
eDocs
RGG NE notes
RGG
CS infrastructure
Grad images
Edit
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback