Feat: Add boot script + Unnattend

This commit is contained in:
Alexandre-Simao 2021-05-31 12:15:06 +02:00
parent a2d340b71b
commit aa56b1de03
8 changed files with 228 additions and 54 deletions

View File

@ -1,13 +0,0 @@
pushd routing ip relay
Install
set global loglevel = ERROR
add dhcpserver 192.168.8.1
add interface name = "Arc-CLI"
set interface name = "Arc-CLI" relaymode = enable maxhop = 6 minsecs = 6
popd

View File

@ -1,11 +0,0 @@
pushd routing ip relay
Install
set global loglevel = ERROR
add dhcpserver 192.168.8.1
add interface name = "Arc-SRV"
set interface name = "Arc-SRV" relaymode = enable maxhop = 6 minsecs = 6
popd

View File

@ -1,11 +0,0 @@
pushd routing ip relay
Install
set global loglevel = ERROR
add dhcpserver 192.168.8.1
add interface name = "Bou-LAN"
set interface name = "Bou-LAN" relaymode = enable maxhop = 6 minsecs = 6
popd

View File

@ -1,11 +0,0 @@
pushd routing ip relay
Install
set global loglevel = ERROR
add dhcpserver 192.168.8.1
set interface name = "WAN" relaymode = enable maxhop = 6 minsecs = 6
popd

View File

@ -11,9 +11,9 @@ echo "Adding and configuring SRV-01"
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\SRV-01.vhdx cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\SRV-01.vhdx
Mount-VHD d:\VHD\SRV-01.vhdx Mount-VHD d:\VHD\SRV-01.vhdx
Copy-Item d:\Unattend\SRV-01.xml -Destination e:\Windows\Panther\Unattend.xml Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination e:\Windows\Panther\Unattend.xml
mkdir e:\Tools\Scripts mkdir e:\Tools\Scripts
Copy-item d:\Scripts\Guests\SRV-01.ps1 E:\Tools\scripts Copy-item d:\Scripts\Guests\SRV-01.ps1 E:\Tools\scripts\boot.ps1
Dismount-VHD d:\VHD\SRV-01.vhdx Dismount-VHD d:\VHD\SRV-01.vhdx
$vms = @{ $vms = @{
@ -40,9 +40,9 @@ echo "Adding and configuring RTR-01"
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-01.vhdx cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-01.vhdx
Mount-VHD d:\VHD\RTR-01.vhdx Mount-VHD d:\VHD\RTR-01.vhdx
Copy-Item d:\Unattend\RTR-01.xml -Destination e:\Windows\Panther\Unattend.xml Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination e:\Windows\Panther\Unattend.xml
mkdir e:\Tools\Scripts mkdir e:\Tools\Scripts
Copy-item d:\Scripts\Guests\RTR-01.ps1 E:\Tools\scripts Copy-item d:\Scripts\Guests\RTR-01.ps1 E:\Tools\scripts\boot.ps1
Dismount-VHD d:\VHD\RTR-01.vhdx Dismount-VHD d:\VHD\RTR-01.vhdx
$vms = @{ $vms = @{
@ -72,9 +72,9 @@ echo "Adding and configuring RTR-02"
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-02.vhdx cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-02.vhdx
Mount-VHD d:\VHD\RTR-02.vhdx Mount-VHD d:\VHD\RTR-02.vhdx
Copy-Item d:\Unattend\RTR-02.xml -Destination e:\Windows\Panther\Unattend.xml Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination e:\Windows\Panther\Unattend.xml
mkdir e:\Tools\Scripts mkdir e:\Tools\Scripts
Copy-item D:\scripts\Guests\RTR-02.ps1 E:\Tools\scripts Copy-item D:\scripts\Guests\RTR-02.ps1 E:\Tools\scripts\boot.ps1
Dismount-VHD d:\VHD\RTR-02.vhdx Dismount-VHD d:\VHD\RTR-02.vhdx
$vms = @{ $vms = @{
@ -104,9 +104,9 @@ echo "Adding and configuring RTR-03"
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-03.vhdx cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-03.vhdx
Mount-VHD d:\VHD\RTR-03.vhdx Mount-VHD d:\VHD\RTR-03.vhdx
Copy-Item d:\Unattend\RTR-03.xml -Destination e:\Windows\Panther\Unattend.xml Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination e:\Windows\Panther\Unattend.xml
mkdir e:\Tools\Scripts mkdir e:\Tools\Scripts
Copy-item d:\Scripts\Guests\RTR-03.ps1 E:\Tools\scripts Copy-item d:\Scripts\Guests\RTR-03.ps1 E:\Tools\scripts\boot.ps1
Dismount-VHD d:\VHD\RTR-03.vhdx Dismount-VHD d:\VHD\RTR-03.vhdx
$vms = @{ $vms = @{

151
Unattend/CLI.xml Normal file
View File

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" 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>040c:0000040c</InputLocale>
<SystemLocale>fr-FR</SystemLocale>
<UILanguage>fr-FR</UILanguage>
<UILanguageFallback>fr-FR</UILanguageFallback>
<UserLocale>fr-FR</UserLocale>
</component>
<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>040c:0000040c</InputLocale>
<SystemLocale>fr-FR</SystemLocale>
<UILanguage>fr-FR</UILanguage>
<UILanguageFallback>fr-FR</UILanguageFallback>
<UserLocale>fr-FR</UserLocale>
</component>
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="x86" 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-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="x86" 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-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="x86" 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>MYCOMPUTER</ComputerName>
<!--
<ProductKey>W269N-WFGWX-YVC9B-4J6C9-T83GX</ProductKey>
-->
</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>MYCOMPUTER</ComputerName>
<!--
<ProductKey>W269N-WFGWX-YVC9B-4J6C9-T83GX</ProductKey>
-->
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" 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>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>AdminLocal</Username>
</AutoLogon>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Home</NetworkLocation>
<SkipUserOOBE>true</SkipUserOOBE>
<SkipMachineOOBE>true</SkipMachineOOBE>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Description>AdminLocal</Description>
<DisplayName>AdminLocal</DisplayName>
<Group>Administrators</Group>
<Name>AdminLocal</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOrganization></RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Description>Control Panel View</Description>
<Order>1</Order>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 0 /f</CommandLine>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Control Panel Icon Size</Description>
<RequiresUserInput>false</RequiresUserInput>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
<TimeZone>Romance Standard Time</TimeZone>
</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">
<AutoLogon>
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>AdminLocal</Username>
</AutoLogon>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Home</NetworkLocation>
<SkipUserOOBE>true</SkipUserOOBE>
<SkipMachineOOBE>true</SkipMachineOOBE>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Description>AdminLocal</Description>
<DisplayName>AdminLocal</DisplayName>
<Group>Administrators</Group>
<Name>AdminLocal</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOrganization></RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Description>Control Panel View</Description>
<Order>1</Order>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 0 /f</CommandLine>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Control Panel Icon Size</Description>
<RequiresUserInput>false</RequiresUserInput>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
<TimeZone>Romance Standard Time</TimeZone>
</component>
</settings>
</unattend>

66
Unattend/SRV.xml Normal file
View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<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">
<ComputerName>*</ComputerName>
<RegisteredOrganization>Aston Ecole</RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<ShowWindowsLive>false</ShowWindowsLive>
</component>
</settings>
<settings pass="oobeSystem">
<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>fr-fr</InputLocale>
<SystemLocale>fr-fr</SystemLocale>
<UILanguage>fr-fr</UILanguage>
<UserLocale>fr-fr</UserLocale>
</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">
<RegisteredOrganization>Aston Ecole</RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<UserAccounts>
<AdministratorPassword>
<Value>Pa$$w0rd</Value>
<PlainText>True</PlainText>
</AdministratorPassword>
</UserAccounts>
<AutoLogon>
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>True</PlainText>
</Password>
<Domain>.</Domain>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>Administrateur</Username>
</AutoLogon>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>c:\conf\deploy.cmd</CommandLine>
<Description>Post Install Script</Description>
<Order>1</Order>
</SynchronousCommand>
</FirstLogonCommands>
<OOBE>
<HideEULAPage>true</HideEULAPage>
</OOBE>
<Display>
<ColorDepth>32</ColorDepth>
<HorizontalResolution>1024</HorizontalResolution>
<VerticalResolution>768</VerticalResolution>
</Display>
</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>
<component name="Microsoft-Windows-ServerManager-SvrMgrNc" 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">
<DoNotOpenServerManagerAtLogon>false</DoNotOpenServerManagerAtLogon>
</component>
<component name="Microsoft-Windows-OutOfBoxExperience" 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">
<DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog:c:/users/maintenance/documents/clg/install_windows server 2008 r2 serverstandard.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

3
deploy.cmd Normal file
View File

@ -0,0 +1,3 @@
powershell c:\Tools\scripts\boot.ps1
start c:\bginfo\startup.cmd
start c:\bginfo\bginfo.cmd