sysprep Windows 2008 não ativando serviço

1

Tenho o seguinte arquivo unattend.xml para o Windows Server 2008 R2 Enterprise.

<?xml version="1.0" encoding="UTF-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:ms="urn:schemas-microsoft-com:asm.v3" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-PnpCustomizationsWinPE"
        publicKeyToken="31bf3856ad364e35" language="neutral"
        versionScope="nonSxS" processorArchitecture="amd64">
            <DriverPaths>
                <PathAndCredentials
                    wcm:action="add"
                    wcm:keyValue="1">
                    <Path>C:\Windows\Temp\virtio</Path>
                </PathAndCredentials>
            </DriverPaths>
        </component>
    <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <SetupUILanguage>
            <UILanguage>en-US</UILanguage>
        </SetupUILanguage>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UserLocale>en-US</UserLocale>
            <UILanguageFallback>en-US</UILanguageFallback>
    <UserLocale>en-US</UserLocale>
    </component>

        <component name="Microsoft-Windows-Setup"
            publicKeyToken="31bf3856ad364e35"
            language="neutral"
            versionScope="nonSxS"
            processorArchitecture="amd64">

            <DiskConfiguration>
                <WillShowUI>OnError</WillShowUI>
                <Disk wcm:action="add">
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>

                    <CreatePartitions>
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Extend>true</Extend>
                            <Type>Primary</Type>
                        </CreatePartition>
                    </CreatePartitions>

                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Format>NTFS</Format>
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                            <Label>System</Label>
                        </ModifyPartition>
                    </ModifyPartitions>
                </Disk>
            </DiskConfiguration>

            <ImageInstall>
                <OSImage>
                    <WillShowUI>Never</WillShowUI>            
                    <InstallFrom>
                        <MetaData>
                            <Key>/IMAGE/Name</Key>
                            <Value>Windows Server 2008 R2 ENTERPRISE</Value>
                        </MetaData>
                    </InstallFrom>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>1</PartitionID>
                    </InstallTo>
                </OSImage>
            </ImageInstall>
            <UserData>
                <AcceptEula>true</AcceptEula>
            </UserData>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ShowWindowsLive>false</ShowWindowsLive>
            <TimeZone>India Standard Time</TimeZone>
        </component>
        <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <fDenyTSConnections>false</fDenyTSConnections>
        </component>
        <component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserAuthentication>0</UserAuthentication>
        </component>
        <component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <FirewallGroups>
            <FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
                <Active>true</Active>
                <Profile>all</Profile>
                <Group>@FirewallAPI.dll,-28752</Group>
            </FirewallGroup>
        </FirewallGroups>
        </component>
    </settings>

    <settings pass="oobeSystem">

        <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RunSynchronous>
    <!--- Firewall to add IMCP -->
                <RunSynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Path>netsh advfirewall firewall add rule name=ICMP protocol=icmpv4 dir=in action=allow</Path>
                    <Description>Add ICMP rule to enable ping on VM</Description>
                </RunSynchronousCommand>
    <!--- Command to enable cloudbase-init -->
                <RunSynchronousCommand wcm:action="add">
                    <Order>2</Order>
                    <Path>sc config cloudbase-init start= auto</Path>
                    <Description>Re-enable auto start of cloudbase-init</Description>
                    <WillReboot>Never</WillReboot>
                </RunSynchronousCommand>

            </RunSynchronous>
        </component>
        <component name="Microsoft-Windows-International-Core" language="neutral" versionScope="nonSxS" publicKeyToken="31bf3856ad364e35" processorArchitecture="amd64" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
            <InputLocale>en-US</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UserLocale>en-US</UserLocale>
            <UILanguageFallback>en-US</UILanguageFallback>
        </component>
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
            </OOBE>
            <TimeZone>Coordinated Universal Time</TimeZone>
            <UserAccounts>
                <AdministratorPassword>
                    <Value>randompass</Value>
                    <PlainText>true</PlainText>
                </AdministratorPassword>
            </UserAccounts>
<!-- Auto logon is commented out -->
<!--            <AutoLogon>
                <Password>
                    <Value>randompass</Value>
                    <PlainText>true</PlainText>
                </Password>
                <Enabled>true</Enabled>
                <LogonCount>50</LogonCount>
                <Username>Administrator</Username>
            </AutoLogon>
-->
        </component>
    </settings>
</unattend>

O problema que enfrento é o cloud-init-base service. Se esse serviço for iniciado automaticamente, ele interferirá no processo sysprep quando a máquina for reiniciada ou inicializada em uma máquina diferente. Então, para concluir o sysprep, desativei este serviço na imagem original.

Agora, o problema é que, uma vez que o sysprep esteja completo e a máquina esteja ativa, cloud-init-base service ainda está desabilitado.

O mesmo arquivo funciona no Windows Server 2012 R2. No entanto, a mesma construção XML não está funcionando no Windows Server 2008 R2. Qual é a maneira de executar o comando no estágio oobe ou ativar o serviço quando o sysprep estiver completo?

    
por doptimusprime 06.10.2016 / 13:31

1 resposta

0

Você precisa adicionar uma etapa automatizada após a reinicialização da máquina para ativar o serviço. Outra etapa na sua sequência de tarefas no SCCM, ou uma chamada de registro 'executar uma vez' executando um script para finalizar a compilação. De qualquer forma, alguns comandos do powershell ( Set-Service e Start-Service ) na sequência de tarefas (se você estiver usando o SCCM) ou em um script chamado de 'executar uma vez' devem resolver o problema.

    
por 06.10.2016 / 14:44