E:\ en-US en-US en-US en-US en-US en-US {% if template_vm_efi is undefined or not template_vm_efi|bool %} true NTFS 1 1 NTFS C 2 2 0 true Primary 1 350 2 Primary true {% else %} 1 NTFS 1 de94bba4-06d1-4d40-a16a-bfd50179d6ac 2 FAT32 2 3 3 NTFS C 4 4 0 true 1 Primary 300 2 EFI 100 3 MSR 128 4 Primary true {% endif %} /IMAGE/INDEX {{ iso_image_index }} 0 {% if template_vm_efi is undefined or not template_vm_efi|bool %} 2 {% else %} 4 {% endif %} true Ansible Your Org. {% if unattend.product_key is defined and unattend.product_key|length %} {{ unattend.product_key | trim }} {% endif %} Never 1 false false en-US en-US en-US en-US true {% if not '2008' in distro_name %} true true true {% endif %} true Home 1 {{ settings.time_zone | default('UTC') }} {% if unattend.administrator_password is defined %} {{ unattend.administrator_password }} true</PlainText> </AdministratorPassword> {% endif %} {% if unattend.local_accounts is defined %} <LocalAccounts> {% for local_account in unattend.local_accounts %} <LocalAccount wcm:action="add"> {% if local_account.password is defined %} <Password> <Value>{{ local_account.password }}</Value> <PlainText>true</PlainText> </Password> {% endif %} {% if local_account.description is defined %} <Description>{{ local_account.description }}</Description> {% endif %} {% if local_account.display_name is defined %} <DisplayName>{{ local_account.display_name }}</DisplayName> {% endif %} {% if local_account.group is defined %} <Group>{{ local_account.group }}</Group> {% endif %} {% if local_account.name is defined %} <Name>{{ local_account.name }}</Name> {% endif %} </LocalAccount> {% endfor %} </LocalAccounts> {% endif %} </UserAccounts> {% if enable_auto_logon and unattend.local_accounts and unattend.local_accounts[0].name and unattend.local_accounts[0].password %} <AutoLogon> <Password> <Value>{{ unattend.local_accounts[0].password }}</Value> <PlainText>true</PlainText> </Password> <Username>{{ unattend.local_accounts[0].name }}</Username> <Enabled>true</Enabled> </AutoLogon> {% endif %} <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> <Description>Set Execution Policy 64 Bit</Description> <Order>1</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> {% if not '2008' in distro_name %} <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c powershell -Command "Set-NetConnectionProfile -NetworkCategory Private"</CommandLine> <Description>Set network connection profile to private</Description> <Order>2</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> {% else %} <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c powershell –EncodedCommand {{ set_network_to_private | b64encode(encoding='utf-16-le') }}</CommandLine> <Description>Set network connection profile to private</Description> <Order>2</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c winrm quickconfig -q</CommandLine> <Description>winrm quickconfig -q</Description> <Order>4</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c winrm quickconfig -transport:http</CommandLine> <Description>winrm quickconfig -transport:http</Description> <Order>5</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}</CommandLine> <Description>Win RM MaxTimoutms</Description> <Order>6</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="800"}</CommandLine> <Description>Win RM MaxMemoryPerShellMB</Description> <Order>7</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}</CommandLine> <Description>Win RM AllowUnencrypted</Description> <Order>8</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}</CommandLine> <Description>Win RM auth Basic</Description> <Order>9</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}</CommandLine> <Description>Win RM client auth Basic</Description> <Order>10</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"} </CommandLine> <Description>Win RM listener Address/Port</Description> <Order>11</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985"</CommandLine> <Description>Win RM port open</Description> <Order>12</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c net stop winrm</CommandLine> <Description>Stop Win RM Service </Description> <Order>13</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c sc config winrm start= auto</CommandLine> <Description>Win RM Autostart</Description> <Order>14</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c net start winrm</CommandLine> <Description>Start Win RM Service</Description> <Order>15</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c dism /online /enable-feature /featurename:NetFx2-ServerCore</CommandLine> <Description>Enable NetFx2-ServerCore feature</Description> <Order>16</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c dism /online /enable-feature /featurename:NetFx2-ServerCore-WOW64</CommandLine> <Description>Enable NetFx2-ServerCore feature</Description> <Order>17</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c dism /online /enable-feature /featurename:MicrosoftWindowsPowerShell</CommandLine> <Description>Enable MicrosoftWindowsPowerShell feature</Description> <Order>18</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c dism /online /enable-feature /featurename:ServerManager-PSH-Cmdlets</CommandLine> <Description>Enable ServerManager-PSH-Cmdlets feature</Description> <Order>19</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> {% endif %} {% if '2016' in distro_name %} <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c reg add HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 /v SchUseStrongCrypto /t REG_DWORD /d 1 /reg:64 /f</CommandLine> <Description>Configure security protocol</Description> <Order>19</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> {% endif %} <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c powershell -ExecutionPolicy ByPass -File E:\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert -EnableCredSSP</CommandLine> <Description>Enable winrm</Description> <Order>20</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c powershell -Command "Enable-WSManCredSSP -Role Server -Force"</CommandLine> <Description>Enable winrm server role</Description> <Order>21</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c powershell -Command "Set-Item -Path 'WSMan:\localhost\Service\Auth\CredSSP' -Value $true"</CommandLine> <Description>Enable credssp authentication</Description> <Order>22</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> {% if template.networks is defined and template.networks[0].ip is defined and template.networks[0].gateway is defined and template.networks[0].netmask is defined %} {% if not '2008' in distro_name %} <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c powershell -Command "New-NetIPAddress –IPAddress {{ template.networks[0].ip }} -DefaultGateway {{ template.networks[0].gateway }} -PrefixLength {{ (template.networks[0].ip + '/' + template.networks[0].netmask) | ipaddr('prefix') }} -InterfaceIndex (Get-NetAdapter).InterfaceIndex"</CommandLine> <Description>Set static ip</Description> <Order>50</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> {% else %} <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c netsh int ipv4 set address "Local Area connection" static {{ template.networks[0].ip }} {{ template.networks[0].netmask }} {{ template.networks[0].gateway }}</CommandLine> <Description>Set static ip</Description> <Order>50</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> {% endif %} {% if template.networks[0].dns_servers is defined %} {% if not '2008' in distro_name %} <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c powershell -Command "Set-DNSClientServerAddress –InterfaceIndex (Get-NetAdapter).InterfaceIndex –ServerAddresses {{ template.networks[0].dns_servers|join(',') }}"</CommandLine> <Description>Set static ip</Description> <Order>51</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> {% else %} <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c netsh int ipv4 set dns "Local Area connection" static {{ template.networks[0].dns_servers[0] }}</CommandLine> <Description>Set static ip</Description> <Order>51</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> {% endif %} {% endif %} {% endif %} </FirstLogonCommands> </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-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> </component> <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <IEHardenAdmin>false</IEHardenAdmin> <IEHardenUser>false</IEHardenUser> </component> <component name="Microsoft-Windows-IE-InternetExplorer" 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"> <SearchScopes> <Scope wcm:action="add"> <ScopeDefault>true</ScopeDefault> <ScopeDisplayName>Google</ScopeDisplayName> <ScopeKey>Google</ScopeKey> <ScopeUrl>http://www.google.com/search?q={searchTerms}</ScopeUrl> </Scope> </SearchScopes> <DisableAccelerators>true</DisableAccelerators> <DisableFirstRunWizard>true</DisableFirstRunWizard> <Home_Page>about:blank</Home_Page> </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> <Group>Remote Desktop</Group> <Profile>all</Profile> </FirewallGroup> </FirewallGroups> </component> <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> </component> <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <SkipAutoActivation>{{ settings.skip_auto_activation | default('true') }}</SkipAutoActivation> </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> </component> </settings> <settings pass="offlineServicing"> <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <EnableLUA>false</EnableLUA> </component> </settings> </unattend>