--
MikeGore - 15 Nov 2010
Windows 10
- We assume you have a fully loaded version of windows and it has been activated
Activation
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
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:
- 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: 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:
- 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
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"
}
}
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 )
sysprep
- Run sysprep with Generalize and Shutdown
Windows 7
External Documents
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
- /unattend: the answer file for unattened operation
- /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
true
- 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
-
- Here is how to reset the 3 limit is sysprep in windows 7
- Reference:
-
- 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)
-
- 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
-
-
- msdtc -uninstall
- msdtc -install
- Restart the computer
-
- 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.
-
- Delete the Panther folder
-
Moving a machine image into a Virtual Machine
Clean Up Steps
- Disable and Re-enable System Restore - to empty the System Volume Backups Data - this can be BIG - you do not have to reboot!
- Delete any archival update/patch directories in the c:\windows directory.
- Clear all Internet cache files, cookies, and temp. files.
- Delete any files in temp directories.
- Clear all Event Viewer logs.
- Empty Recycle bin.
- 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
- Disable and renable System Restore - to empty the System Volume Backups Data - this can be BIG - you do not have to reboot!
- Delete any archival update/patch directories in the c:\windows directory.
- Clear all Internet cache files, cookies, and temp. files.
- Delete any files in temp directories.
- Clear all Event Viewer logs.
- Empty Recycle bin.
- Change network settings so TCP/IP settings use DHCP not static address.
Sysprep Process
- 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)
- CD \sysprep
- Edit sysprep.inf and make any changes you need - normally only need to add an extra drivers entry)
- run sysprep.exe - use mini setup option and select RESEAL
- Restart the PC with a RIP + GHOST CD - or PXE boot on Vlan 420
- //asimov:/images/rawiso/linux_utils/RIP/RIP11.0/RIPLinuX-11.0.iso
- Note: RIP has been modified by the CSCF Research Group
- Read over ImageDeploymentGhost