Skip to content

Instantly share code, notes, and snippets.

@tiberiosantos
Created July 19, 2022 20:38
Show Gist options
  • Select an option

  • Save tiberiosantos/9893785a2afe5de9bea5f90c3b25d837 to your computer and use it in GitHub Desktop.

Select an option

Save tiberiosantos/9893785a2afe5de9bea5f90c3b25d837 to your computer and use it in GitHub Desktop.
Generalizando uma imagem do Windows para implantação
C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /unattend:<CAMINHO>\unattend.xml /quiet /shutdown
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SkipRearm>1</SkipRearm>
</component>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<PersistAllDeviceInstalls>false</PersistAllDeviceInstalls>
<DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices>
</component>
</settings>
<settings pass="specialize">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<!--<ProductKey>6XBNX-4JQGW-QX6QG-74P76-72V67</ProductKey>-->
<ComputerName>WIN10</ComputerName>
</component>
<!--
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>powershell -ExecutionPolicy RemoteSigned -Command "&amp; $env:PROGRAMDATA\Packer\spiceworks-decrapifier.ps1 -ClearStart"</Path>
<Description>Remove Bloatware do Windows 10</Description>
</RunSynchronousCommand>
</RunSynchronous>
</component>
-->
</settings>
<settings pass="oobeSystem">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<InputLocale>0416:00000416</InputLocale>
<SystemLocale>pt-BR</SystemLocale>
<UILanguage>pt-BR</UILanguage>
<UILanguageFallback>pt-BR</UILanguageFallback>
<UserLocale>pt-BR</UserLocale>
</component>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
<SkipUserOOBE>true</SkipUserOOBE>
<SkipMachineOOBE>true</SkipMachineOOBE>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<TimeZone>E. South America Standard Time</TimeZone>
<AutoLogon>
<Password>
<Value><!--Senha--><Value/>
<PlainText>true</PlainText>
</Password>
<Username>Administrator</Username>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
</AutoLogon>
<UserAccounts>
<AdministratorPassword>
<Value><!--Senha--><Value/>
<PlainText>true</PlainText>
</AdministratorPassword>
</UserAccounts>
<!--
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>powershell -ExecutionPolicy RemoteSigned -Command "&amp; $env:PROGRAMDATA\Packer\drivers.ps1 -Credential WORKGROUP\deployer -Password p@$$w0rd+ -Share \\storage\drivers -Import"</CommandLine>
<Description>Instala os drivers do sistema</Description>
<Order>1</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>powershell -ExecutionPolicy RemoteSigned -Command "&amp; $env:PROGRAMDATA\Packer\bootstrap.ps1 -Setup"</CommandLine>
<Description>Configura o WinRM e limpa os arquivos de implantação</Description>
<Order>2</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
</FirstLogonCommands>
-->
</component>
</settings>
</unattend>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment