266 lines
		
	
	
		
			15 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			266 lines
		
	
	
		
			15 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
<!--*************************************************
 | 
						||
Windows Server 2019 Answer File Generator
 | 
						||
Created using Windows AFG found at:
 | 
						||
;http://www.windowsafg.com
 | 
						||
 | 
						||
Installation Notes:
 | 
						||
- This file need to be adapted based on your needs
 | 
						||
**************************************************-->
 | 
						||
 | 
						||
<?xml version="1.0" encoding="utf-8"?>
 | 
						||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
 | 
						||
    <settings pass="windowsPE">
 | 
						||
        <component name="Microsoft-Windows-PnpCustomizationsWinPE" 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">
 | 
						||
            <DriverPaths>
 | 
						||
                <PathAndCredentials wcm:action="add" wcm:keyValue="1">
 | 
						||
                    <Path>e:\Windows Server 2022\x64</Path>
 | 
						||
                </PathAndCredentials>
 | 
						||
            </DriverPaths>
 | 
						||
        </component>
 | 
						||
        <component name="Microsoft-Windows-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">
 | 
						||
            <DiskConfiguration>
 | 
						||
                <Disk wcm:action="add">
 | 
						||
                    <CreatePartitions>
 | 
						||
                        <CreatePartition wcm:action="add">
 | 
						||
                            <Order>1</Order>
 | 
						||
                            <Size>350</Size>
 | 
						||
                            <Type>Primary</Type>
 | 
						||
                        </CreatePartition>
 | 
						||
                        <CreatePartition wcm:action="add">
 | 
						||
                            <Order>2</Order>
 | 
						||
                            <Extend>true</Extend>
 | 
						||
                            <Type>Primary</Type>
 | 
						||
                        </CreatePartition>
 | 
						||
                    </CreatePartitions>
 | 
						||
                    <ModifyPartitions>
 | 
						||
                        <ModifyPartition wcm:action="add">
 | 
						||
                            <Format>NTFS</Format>
 | 
						||
                            <Label>System</Label>
 | 
						||
                            <Order>1</Order>
 | 
						||
                            <PartitionID>1</PartitionID>
 | 
						||
                            <TypeID>0x27</TypeID>
 | 
						||
                        </ModifyPartition>
 | 
						||
                        <ModifyPartition wcm:action="add">
 | 
						||
                            <Order>2</Order>
 | 
						||
                            <PartitionID>2</PartitionID>
 | 
						||
                            <Letter>C</Letter>
 | 
						||
                            <Label>OS</Label>
 | 
						||
                            <Format>NTFS</Format>
 | 
						||
                        </ModifyPartition>
 | 
						||
                    </ModifyPartitions>
 | 
						||
                    <DiskID>0</DiskID>
 | 
						||
                    <WillWipeDisk>true</WillWipeDisk>
 | 
						||
                </Disk>
 | 
						||
            </DiskConfiguration>
 | 
						||
            <ImageInstall>
 | 
						||
                <OSImage>
 | 
						||
                    <InstallTo>
 | 
						||
                        <DiskID>0</DiskID>
 | 
						||
                        <PartitionID>2</PartitionID>
 | 
						||
                    </InstallTo>
 | 
						||
                    <InstallFrom>
 | 
						||
                        <MetaData wcm:action="add">
 | 
						||
                            <Key>/IMAGE/NAME</Key>
 | 
						||
                            <Value>Windows Server 2022 SERVERSTANDARDCORE</Value>
 | 
						||
                        </MetaData>
 | 
						||
                    </InstallFrom>
 | 
						||
                </OSImage>
 | 
						||
            </ImageInstall>
 | 
						||
            <UserData>
 | 
						||
                <AcceptEula>true</AcceptEula>
 | 
						||
                <FullName>Administrator</FullName>
 | 
						||
                <Organization>Organization</Organization>
 | 
						||
                <ProductKey>
 | 
						||
                    <Key>VDYBN-27WPP-V4HQT-9VMD4-VMK7H</Key>
 | 
						||
                    <WillShowUI>OnError</WillShowUI>
 | 
						||
                </ProductKey>
 | 
						||
            </UserData>
 | 
						||
            <EnableFirewall>true</EnableFirewall>
 | 
						||
        </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>
 | 
						||
            <InputLocale>0409:00000409</InputLocale>
 | 
						||
            <SystemLocale>en-US</SystemLocale>
 | 
						||
            <UILanguage>en-US</UILanguage>
 | 
						||
            <UILanguageFallback>en-US</UILanguageFallback>
 | 
						||
            <UserLocale>en-US</UserLocale>
 | 
						||
        </component>
 | 
						||
    </settings>
 | 
						||
    <settings pass="offlineServicing">
 | 
						||
        <component name="Microsoft-Windows-LUA-Settings" 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">
 | 
						||
            <EnableLUA>false</EnableLUA>
 | 
						||
        </component>
 | 
						||
    </settings>
 | 
						||
    <settings pass="generalize">
 | 
						||
        <component name="Microsoft-Windows-Security-SPP" 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">
 | 
						||
            <SkipRearm>1</SkipRearm>
 | 
						||
        </component>
 | 
						||
    </settings>
 | 
						||
    <settings pass="specialize">
 | 
						||
        <component name="Microsoft-Windows-International-Core" 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">
 | 
						||
            <InputLocale>0409:00000409</InputLocale>
 | 
						||
            <SystemLocale>en-US</SystemLocale>
 | 
						||
            <UILanguage>en-US</UILanguage>
 | 
						||
            <UILanguageFallback>en-US</UILanguageFallback>
 | 
						||
            <UserLocale>en-US</UserLocale>
 | 
						||
        </component>
 | 
						||
        <component name="Microsoft-Windows-Security-SPP-UX" 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">
 | 
						||
            <SkipAutoActivation>true</SkipAutoActivation>
 | 
						||
        </component>
 | 
						||
        <component name="Microsoft-Windows-SQMApi" 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">
 | 
						||
            <CEIPEnabled>0</CEIPEnabled>
 | 
						||
        </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">
 | 
						||
            <ComputerName></ComputerName>
 | 
						||
            <ProductKey>VDYBN-27WPP-V4HQT-9VMD4-VMK7H</ProductKey>
 | 
						||
        </component>
 | 
						||
    </settings>
 | 
						||
    <settings pass="oobeSystem">
 | 
						||
        <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">
 | 
						||
            <AutoLogon>
 | 
						||
                <Password>
 | 
						||
                    <Value>S3cr3t0!</Value>
 | 
						||
                    <PlainText>true</PlainText>
 | 
						||
                </Password>
 | 
						||
                <Enabled>true</Enabled>
 | 
						||
                <Username>Administrator</Username>
 | 
						||
            </AutoLogon>
 | 
						||
            <FirstLogonCommands>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <Order>1</Order>
 | 
						||
                    <Description>Set Execution Policy 64 Bit</Description>
 | 
						||
                    <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine>
 | 
						||
                    <RequiresUserInput>true</RequiresUserInput>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <Order>2</Order>
 | 
						||
                    <Description>Set Execution Policy 32 Bit</Description>
 | 
						||
                    <CommandLine>%SystemDrive%\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine>
 | 
						||
                    <RequiresUserInput>true</RequiresUserInput>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine>
 | 
						||
                    <Order>3</Order>
 | 
						||
                    <Description>Show file extensions in Explorer</Description>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f</CommandLine>
 | 
						||
                    <Order>4</Order>
 | 
						||
                    <Description>Enable QuickEdit mode</Description>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f</CommandLine>
 | 
						||
                    <Order>5</Order>
 | 
						||
                    <Description>Show Run command in Start Menu</Description>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f</CommandLine>
 | 
						||
                    <Order>6</Order>
 | 
						||
                    <Description>Show Administrative Tools in Start Menu</Description>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f</CommandLine>
 | 
						||
                    <Order>7</Order>
 | 
						||
                    <Description>Zero Hibernation File</Description>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f</CommandLine>
 | 
						||
                    <Order>8</Order>
 | 
						||
                    <Description>Disable Hibernation Mode</Description>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>cmd.exe /c wmic useraccount where "name='Administrator'" set PasswordExpires=FALSE</CommandLine>
 | 
						||
                    <Order>9</Order>
 | 
						||
                    <Description>Disable password expiration for Administrator user</Description>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "WinRMCertificate"</CommandLine>
 | 
						||
                    <Description>Certificate for WinRM</Description>
 | 
						||
                    <Order>10</Order>
 | 
						||
                    <RequiresUserInput>true</RequiresUserInput>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command Enable-PSRemoting -SkipNetworkProfileCheck -Force</CommandLine>
 | 
						||
                    <Description>Enable WinRM</Description>
 | 
						||
                    <Order>11</Order>
 | 
						||
                    <RequiresUserInput>true</RequiresUserInput>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command ($cert = gci Cert:\LocalMachine\My\) -and (New-Item -Path WSMan:\LocalHost\Listener -Transport HTTPS -Address * -CertificateThumbPrint $cert.Thumbprint –Force)</CommandLine>
 | 
						||
                    <Description>Add HTTPS WinRM listener with previously generated certificate</Description>
 | 
						||
                    <Order>12</Order>
 | 
						||
                    <RequiresUserInput>true</RequiresUserInput>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command New-NetFirewallRule -DisplayName 'Windows Remote Management (HTTPS-In)' -Name 'Windows Remote Management (HTTPS-In)' -Profile Any -LocalPort 5986 -Protocol TCP</CommandLine>
 | 
						||
                    <Description>Add firewall exception to TCP port 5986 for WinRM over HTTPS</Description>
 | 
						||
                    <Order>13</Order>
 | 
						||
                    <RequiresUserInput>true</RequiresUserInput>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command Set-Item WSMan:\localhost\Service\Auth\Basic -Value $true</CommandLine>
 | 
						||
                    <Description>Enable Basic authentication</Description>
 | 
						||
                    <Order>14</Order>
 | 
						||
                    <RequiresUserInput>true</RequiresUserInput>
 | 
						||
                </SynchronousCommand>
 | 
						||
                <SynchronousCommand wcm:action="add">
 | 
						||
                    <CommandLine>cmd.exe /c f:\disable-network-discovery.cmd</CommandLine>
 | 
						||
                    <Description>Disable Network Discovery</Description>
 | 
						||
                    <Order>15</Order>
 | 
						||
                </SynchronousCommand>
 | 
						||
            </FirstLogonCommands>
 | 
						||
            <OOBE>
 | 
						||
                <HideEULAPage>true</HideEULAPage>
 | 
						||
                <HideLocalAccountScreen>true</HideLocalAccountScreen>
 | 
						||
                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
 | 
						||
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
 | 
						||
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
 | 
						||
                <NetworkLocation>Work</NetworkLocation>
 | 
						||
                <ProtectYourPC>1</ProtectYourPC>
 | 
						||
                <SkipMachineOOBE>true</SkipMachineOOBE>
 | 
						||
                <SkipUserOOBE>true</SkipUserOOBE>
 | 
						||
            </OOBE>
 | 
						||
            <RegisteredOrganization>Organization</RegisteredOrganization>
 | 
						||
            <RegisteredOwner>Owner</RegisteredOwner>
 | 
						||
            <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
 | 
						||
            <TimeZone>Pacific Standard Time</TimeZone>
 | 
						||
            <UserAccounts>
 | 
						||
                <AdministratorPassword>
 | 
						||
                    <Value>S3cr3t0!</Value>
 | 
						||
                    <PlainText>true</PlainText>
 | 
						||
                </AdministratorPassword>
 | 
						||
                <LocalAccounts>
 | 
						||
                    <LocalAccount wcm:action="add">
 | 
						||
                        <Description>Administrator</Description>
 | 
						||
                        <DisplayName>Administrator</DisplayName>
 | 
						||
                        <Group>Administrators</Group>
 | 
						||
                        <Name>Administrator</Name>
 | 
						||
                    </LocalAccount>
 | 
						||
                </LocalAccounts>
 | 
						||
            </UserAccounts>
 | 
						||
        </component>
 | 
						||
    </settings>
 | 
						||
</unattend>
 |