Skip to content

Commit

Permalink
Merge pull request #418 from gusztavvargadr/feature/update-for-2310-415
Browse files Browse the repository at this point in the history
Update for 2310
  • Loading branch information
gusztavvargadr committed Oct 17, 2023
2 parents 5e99e9e + 57f9c28 commit 060cc18
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/gusztavvargadr/chef
37 changes: 37 additions & 0 deletions src/w101809eltsc/packer/builders/iso/floppy/Autounattend.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Write-Host "Configure PowerShell"
Set-ExecutionPolicy RemoteSigned -Force
$ProgressPreference = 'SilentlyContinue'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Write-Host "Install Chocolatey"
$env:chocolateyVersion = '1.4.0'
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression

Write-Host "Install OpenSSH"
netsh advfirewall firewall add rule name="OpenSSH-Install" dir=in localport=22 protocol=TCP action=block
choco install openssh -y --version 8.0.0.1 -params '"/SSHServerFeature"' # /PathSpecsToProbeForShellEXEString:$env:windir\system32\windowspowershell\v1.0\powershell.exe"'
net stop sshd
netsh advfirewall firewall delete rule name="OpenSSH-Install"

Write-Host "Configure OpenSSH"
$sshd_config = "$($env:ProgramData)\ssh\sshd_config"
(Get-Content $sshd_config).Replace("Match Group administrators", "# Match Group administrators") | Set-Content $sshd_config
(Get-Content $sshd_config).Replace("AuthorizedKeysFile", "# AuthorizedKeysFile") | Set-Content $sshd_config
net start sshd

Write-Host "Install WinRM"
netsh advfirewall firewall add rule name="WinRM-Install" dir=in localport=5985 protocol=TCP action=block
Get-NetConnectionProfile | ForEach-Object { Set-NetConnectionProfile -InterfaceIndex $_.InterfaceIndex -NetworkCategory Private }
winrm quickconfig -q
winrm quickconfig -transport:http
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="800"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/client/auth '@{Basic="true"}'
net stop winrm
netsh advfirewall firewall delete rule name="WinRM-Install"

Write-Host "Configure WinRM"
netsh advfirewall firewall add rule name="WinRM-HTTP" dir=in localport=5985 protocol=TCP action=allow
net start winrm
2 changes: 1 addition & 1 deletion src/w11ipe/packer/builders/iso/template.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"variables": {
"iso_url_local": "{{user `download_directory`}}/Windows11_InsiderPreview_EnterpriseVL_x64_en-us_25951.iso",
"iso_url_remote": "https://bit.ly/3rQNkTc",
"iso_url_remote": "https://app.vagrantup.com/gusztavvargadr-iso/boxes/windows-11-insider-preview/versions/2202.0.2310/providers/iso-hosted/amd64/vagrant.box",
"iso_checksum": "sha256:e771769bc27aec3361bae30ef86addc1f9934553270fea83a38f33d54475dc73"
}
}
37 changes: 37 additions & 0 deletions src/ws2019s/packer/builders/iso/floppy/Autounattend.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Write-Host "Configure PowerShell"
Set-ExecutionPolicy RemoteSigned -Force
$ProgressPreference = 'SilentlyContinue'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Write-Host "Install Chocolatey"
$env:chocolateyVersion = '1.4.0'
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression

Write-Host "Install OpenSSH"
netsh advfirewall firewall add rule name="OpenSSH-Install" dir=in localport=22 protocol=TCP action=block
choco install openssh -y --version 8.0.0.1 -params '"/SSHServerFeature"' # /PathSpecsToProbeForShellEXEString:$env:windir\system32\windowspowershell\v1.0\powershell.exe"'
net stop sshd
netsh advfirewall firewall delete rule name="OpenSSH-Install"

Write-Host "Configure OpenSSH"
$sshd_config = "$($env:ProgramData)\ssh\sshd_config"
(Get-Content $sshd_config).Replace("Match Group administrators", "# Match Group administrators") | Set-Content $sshd_config
(Get-Content $sshd_config).Replace("AuthorizedKeysFile", "# AuthorizedKeysFile") | Set-Content $sshd_config
net start sshd

Write-Host "Install WinRM"
netsh advfirewall firewall add rule name="WinRM-Install" dir=in localport=5985 protocol=TCP action=block
Get-NetConnectionProfile | ForEach-Object { Set-NetConnectionProfile -InterfaceIndex $_.InterfaceIndex -NetworkCategory Private }
winrm quickconfig -q
winrm quickconfig -transport:http
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="800"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/client/auth '@{Basic="true"}'
net stop winrm
netsh advfirewall firewall delete rule name="WinRM-Install"

Write-Host "Configure WinRM"
netsh advfirewall firewall add rule name="WinRM-HTTP" dir=in localport=5985 protocol=TCP action=allow
net start winrm
2 changes: 1 addition & 1 deletion src/wsips/packer/builders/iso/template.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"variables": {
"iso_url_local": "{{user `download_directory`}}/Windows_InsiderPreview_Server_vNext_en-us_25967.iso",
"iso_url_remote": "https://bit.ly/3RWqdB5",
"iso_url_remote": "https://app.vagrantup.com/gusztavvargadr-iso/boxes/windows-server-insider-preview/versions/2102.0.2310/providers/iso-hosted/amd64/vagrant.box",
"iso_checksum": "sha256:e20547ac8bcca26866b2882dcbee3616851a134b0387225bebabfb87bbf1b003"
}
}

0 comments on commit 060cc18

Please sign in to comment.