en-US en-US en-US en-US en-US 1 500 Primary 2 true Primary true NTFS 1 1 NTFS C 2 2 0 true 0 2 false true Ansible Admin {{ organization | default('ToalLab') }} {{ vm_name }} {{ timezone | default('Eastern Standard Time') }} false 0 true Remote Desktop all true Windows Remote Management all {{ vm_admin_password | default('P@ssw0rd123!') }} true</PlainText> </Password> <Enabled>true</Enabled> <LogonCount>3</LogonCount> <Username>Administrator</Username> </AutoLogon> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <CommandLine>cmd.exe /c netsh advfirewall firewall add rule name="WinRM HTTP" dir=in action=allow protocol=TCP localport=5985</CommandLine> <Description>Enable WinRM HTTP</Description> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>2</Order> <CommandLine>cmd.exe /c netsh advfirewall firewall add rule name="WinRM HTTPS" dir=in action=allow protocol=TCP localport=5986</CommandLine> <Description>Enable WinRM HTTPS</Description> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>3</Order> <CommandLine>powershell.exe -Command "Enable-PSRemoting -Force"</CommandLine> <Description>Enable PowerShell Remoting</Description> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>4</Order> <CommandLine>powershell.exe -Command "Set-Item -Path WSMan:\localhost\Service\Auth\Basic -Value $true"</CommandLine> <Description>Enable Basic Auth for WinRM</Description> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>5</Order> <CommandLine>powershell.exe -Command "Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False"</CommandLine> <Description>Disable Windows Firewall for initial setup</Description> </SynchronousCommand> {% if vm_ip_address is defined %} <SynchronousCommand wcm:action="add"> <Order>6</Order> <CommandLine>powershell.exe -Command "New-NetIPAddress -InterfaceAlias 'Ethernet' -IPAddress {{ vm_ip_address }} -PrefixLength {{ vm_subnet_prefix | default('24') }} -DefaultGateway {{ vm_gateway | default('192.168.1.1') }}"</CommandLine> <Description>Set static IP address</Description> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>7</Order> <CommandLine>powershell.exe -Command "Set-DnsClientServerAddress -InterfaceAlias 'Ethernet' -ServerAddresses {{ dns_servers | join(',') }}"</CommandLine> <Description>Set DNS servers</Description> </SynchronousCommand> {% endif %} </FirstLogonCommands> <OOBE> <HideEULAPage>true</HideEULAPage> <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> <HideOnlineAccountScreens>true</HideOnlineAccountScreens> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> <NetworkLocation>Work</NetworkLocation> <ProtectYourPC>3</ProtectYourPC> <SkipMachineOOBE>true</SkipMachineOOBE> <SkipUserOOBE>true</SkipUserOOBE> </OOBE> <UserAccounts> <AdministratorPassword> <Value>{{ vm_admin_password | default('P@ssw0rd123!') }}</Value> <PlainText>true</PlainText> </AdministratorPassword> </UserAccounts> </component> </settings> </unattend>