Skip to content

Commit

Permalink
Merge branch 'master' into user/michbern/dchydrate
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Bernstein (DPLAT) authored and Michael Bernstein (DPLAT) committed Jun 21, 2024
2 parents f20e9a7 + 9ffe266 commit 5ad7331
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 33 deletions.
30 changes: 22 additions & 8 deletions Scripts/0_DCHydrate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ function Hydrate-DC {
New-item -type directory -Path "$mountdir\Windows\Panther" -force
Copy-Item -Path $unattendfile -Destination "$mountdir\Windows\Panther\unattend.xml" -force
Copy-Item -Path "$PSScriptRoot\Temp\DSC\*" -Destination "$mountdir\Program Files\WindowsPowerShell\Modules\" -Recurse -force
WriteInfoHighlighted "`t Adding Hyper-V feature into DC"
#Install Hyper-V feature
Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Path "$mountdir"

#Create credentials for DSC

Expand Down Expand Up @@ -189,9 +192,9 @@ function Hydrate-DC {
Import-DSCResource -ModuleName NetworkingDSC -ModuleVersion "9.0.0"
Import-DSCResource -ModuleName xDHCPServer -ModuleVersion "3.1.1"
Import-DSCResource -ModuleName xPSDesiredStateConfiguration -ModuleVersion "9.1.0"
Import-DSCResource -ModuleName xHyper-V -ModuleVersion "3.18.0"
Import-DscResource -ModuleName PSDesiredStateConfiguration


Node $AllNodes.Where{$_.Role -eq "Parent DC"}.Nodename

{
Expand Down Expand Up @@ -229,12 +232,22 @@ function Hydrate-DC {
DependsOn = "[WindowsFeature]ADDSInstall"
}

WindowsFeature FeatureDNSTools
WindowsFeature Hyper-V-PowerShell
{
Ensure = "Present"
Name = "RSAT-DNS-Server"
DependsOn = "[WindowsFeature]ADDSInstall"
}
Name = "Hyper-V-PowerShell"
}

xVMSwitch VMSwitch
{
Ensure = "Present"
Name = "vSwitch"
Type = "External"
AllowManagementOS = $true
NetAdapterName = "Ethernet"
EnableEmbeddedTeaming = $true
DependsOn = "[WindowsFeature]Hyper-V-PowerShell"
}

ADDomain FirstDS
{
Expand Down Expand Up @@ -349,9 +362,11 @@ function Hydrate-DC {
IPaddress IP
{
IPAddress = ($DhcpScope+"1/24")
AddressFamily = 'IPv4'
InterfaceAlias = 'Ethernet'
AddressFamily = "IPv4"
InterfaceAlias = "vEthernet (vSwitch)"
DependsOn = "[xVMSwitch]VMSwitch"
}

WindowsFeature DHCPServer
{
Ensure = "Present"
Expand All @@ -373,7 +388,6 @@ function Hydrate-DC {
DependsOn = "[WindowsFeature]DHCPServer"
}


xDhcpServerScope ManagementScope
{
Ensure = 'Present'
Expand Down
2 changes: 1 addition & 1 deletion Scripts/1_Prereq.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function Get-WindowsBuildNumber {
#region Downloading required Posh Modules
# Downloading modules into Temp folder if needed.

$modules=("ActiveDirectoryDsc","6.3.0"),("xDHCPServer","3.1.1"),("DnsServerDsc","3.0.0"),("NetworkingDSC","9.0.0"),("xPSDesiredStateConfiguration","9.1.0")
$modules=("ActiveDirectoryDsc","6.3.0"),("xDHCPServer","3.1.1"),("DnsServerDsc","3.0.0"),("NetworkingDSC","9.0.0"),("xPSDesiredStateConfiguration","9.1.0"),("xHyper-V","3.18.0")
foreach ($module in $modules){
WriteInfoHighlighted "Testing if modules are present"
$modulename=$module[0]
Expand Down
24 changes: 12 additions & 12 deletions Scripts/2_CreateParentDisks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,6 @@ If (-not $isAdmin) {
VHDName="Win2022Core_G2.vhdx"
Size=127GB
}
}elseif ($BuildNumber -gt 20348 -and $SAC){
$ServerVHDs += @{
Kind = "Core"
Edition="2"
VHDName="WinSrvInsiderCore_$BuildNumber.vhdx"
Size=127GB
}
#DCEdition fix
if ($LabConfig.DCEdition -gt 2){
$LabConfig.DCEdition=2
}
}elseif ($BuildNumber -eq 26100){
#Windows Server 2025
$ServerVHDs += @{
Expand All @@ -345,8 +334,19 @@ If (-not $isAdmin) {
Edition="3"
VHDName="Win2025Core_G2.vhdx"
Size=127GB
}
}elseif ($BuildNumber -gt 26100 -and $SAC){
$ServerVHDs += @{
Kind = "Core"
Edition="2"
VHDName="WinSrvInsiderCore_$BuildNumber.vhdx"
Size=127GB
}
#DCEdition fix
if ($LabConfig.DCEdition -gt 2){
$LabConfig.DCEdition=2
}
}elseif ($BuildNumber -gt 23100){
}elseif ($BuildNumber -gt 26100){
#Windows Sever Insider
$ServerVHDs += @{
Kind = "Full"
Expand Down
14 changes: 6 additions & 8 deletions Scripts/LabConfig.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#basic config for Windows Server 2022, that creates VMs for S2D Hyperconverged scenario https://github.com/Microsoft/MSLab/tree/master/Scenarios/S2D%20Hyperconverged

$LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'MSLab-' ; DCEdition='4'; Internet=$true ; AdditionalNetworksConfig=@(); VMs=@()}
$LabConfig=@{AllowedVLANs="1-10,711-719" ; DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'MSLab-' ; DCEdition='4'; Internet=$true ; AdditionalNetworksConfig=@(); VMs=@()}
# Windows Server 2022
1..4 | ForEach-Object {$VMNames="S2D"; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'Win2022Core_G2.vhdx'; SSDNumber = 0; SSDSize=800GB ; HDDNumber = 12; HDDSize= 4TB ; MemoryStartupBytes= 512MB }}
# Or Azure Stack HCI 21H2
#1..4 | ForEach-Object {$VMNames="AzSHCI"; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI21H2_G2.vhdx'; SSDNumber = 0; SSDSize=800GB ; HDDNumber = 12; HDDSize= 4TB ; MemoryStartupBytes= 1GB }}
# Or Windows Server 2019
#1..4 | ForEach-Object {$VMNames="S2D"; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'Win2019Core_G2.vhdx'; SSDNumber = 0; SSDSize=800GB ; HDDNumber = 12; HDDSize= 4TB ; MemoryStartupBytes= 512MB }}
# Or Windows Server 2025
#1..4 | ForEach-Object {$VMNames="S2D"; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'Win2025Core_G2.vhdx'; SSDNumber = 0; SSDSize=800GB ; HDDNumber = 12; HDDSize= 4TB ; MemoryStartupBytes= 512MB }}
1..4 | ForEach-Object {$LABConfig.VMs += @{ VMName = "$S2D$_" ; Configuration = 'S2D' ; ParentVHD = 'Win2022Core_G2.vhdx'; SSDNumber = 0; SSDSize=800GB ; HDDNumber = 12; HDDSize= 4TB ; MemoryStartupBytes= 512MB }}
# Or Azure Stack HCI 23H2 (non-domain joined) https://github.com/DellGEOS/AzureStackHOLs/tree/main/lab-guides/01a-DeployAzureStackHCICluster-CloudBasedDeployment
#1..2 | ForEach-Object {$LABConfig.VMs += @{ VMName = "ASNode$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI23H2_G2.vhdx' ; HDDNumber = 4 ; HDDSize= 2TB ; MemoryStartupBytes= 20GB; VMProcessorCount=16 ; vTPM=$true ; Unattend="NoDjoin" ; NestedVirt=$true }}
# Or Windows Server 2025 https://github.com/DellGEOS/AzureStackHOLs/tree/main/lab-guides/03-TestingWindowsServerInsider
#1..2 | ForEach-Object {$LABConfig.VMs += @{ VMName="S2D$_" ; Configuration='S2D' ; ParentVHD='WinSrvInsiderCore_26063.vhdx' ; HDDNumber=4 ; HDDSize=2TB ; MemoryStartupBytes=1GB; VMProcessorCount=4 ; vTPM=$true}}

### HELP ###

Expand Down
20 changes: 16 additions & 4 deletions Tools/CreateParentDisk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,11 @@ If (-not $isAdmin) {
25398 {
"AzSHCI23H2_G2.vhdx"
}
26100 {
"AzSHCI24H2_G2.vhdx"
}
}
if ($BuildNumber -GT 25398){
if ($BuildNumber -GT 26100){
$tempvhdname="AzSHCIInsider_$BuildNumber.vhdx"
}
}elseif (($Edition -like "*Server*Core*") -or ($Edition -like "Windows Server * Datacenter") -or ($Edition -like "Windows Server * Standard")){
Expand Down Expand Up @@ -216,8 +219,11 @@ If (-not $isAdmin) {
20348 {
"Win2022Core_G2.vhdx"
}
26100 {
"Win2025Core_G2.vhdx"
}
}
if ($BuildNumber -gt 20348){
if ($BuildNumber -gt 26100){
$tempvhdname="WinSrvInsiderCore_$BuildNumber.vhdx"
}
}elseif($Edition -like "Hyper-V*"){
Expand Down Expand Up @@ -258,8 +264,11 @@ If (-not $isAdmin) {
20348 {
"Win2022_G2.vhdx"
}
26100 {
"Win2025_G2.vhdx"
}
}
if ($BuildNumber -GT 20348){
if ($BuildNumber -GT 26100){
$tempvhdname="WinSrvInsider_$BuildNumber.vhdx"
}
}else{
Expand Down Expand Up @@ -312,8 +321,11 @@ If (-not $isAdmin) {
22621 {
"Win1122H2_G2.vhdx"
}
26100 {
"Win1124H2_G2.vhdx"
}
}
if ($BuildNumber -GT 22621){
if ($BuildNumber -GT 26100){
$tempvhdname="Win11Insider_$BuildNumber.vhdx"
}
}
Expand Down
2 changes: 2 additions & 0 deletions Tools/DownloadLatestCUs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ if ($version.Minor -eq 27){
}

$Products=@()
$Products+=@{Product="Azure Stack HCI 24H2 and Windows Server 2025" ;SearchString="Cumulative Update for Microsoft server operating system version 24H2 for x64-based Systems" ;SSUSearchString=$null ; ID="Microsoft Server operating system-24H2"}
$Products+=@{Product="Azure Stack HCI 23H2" ;SearchString="Cumulative Update for Microsoft server operating system version 23H2 for x64-based Systems" ;SSUSearchString=$null ; ID="Microsoft Server operating system-23H2"} #MSFT really removed the ',' in CUs
$Products+=@{Product="Azure Stack HCI 22H2" ;SearchString="Cumulative Update for Microsoft server operating system version 22H2 for x64-based Systems" ;SSUSearchString=$null ; ID="Microsoft Server operating system-22H2"}
$Products+=@{Product="Azure Stack HCI 21H2 and Windows Server 2022" ;SearchString="Cumulative Update for Microsoft server operating system version 21H2 for x64-based Systems" ;SSUSearchString="Servicing Stack Update for Microsoft server operating system version 21H2 for x64-based Systems" ; ID="Microsoft Server operating system-21H2"}
$Products+=@{Product="Azure Stack HCI 20H2" ;SearchString="Cumulative Update for Azure Stack HCI, version 20H2" ;SSUSearchString="Servicing Stack Update for Azure Stack HCI, version 20H2 for x64-based Systems" ; ID="Azure Stack HCI"} #unsupported release SSU no longer required but remain for compat reasons
$Products+=@{Product="Windows Server 2019" ;SearchString="Cumulative Update for Windows Server 2019 for x64-based Systems" ;SSUSearchString="Servicing Stack Update for Windows Server 2019 for x64-based Systems" ; ID="Windows Server 2019"} #SSU no longer required but remain for compat reasons
$Products+=@{Product="Windows Server 2016" ;SearchString="Cumulative Update for Windows Server 2016 for x64-based Systems" ;SSUSearchString="Servicing Stack Update for Windows Server 2016 for x64-based Systems" ; ID="Windows Server 2016"} #SSU no longer required but remain for compat reasons
$Products+=@{Product="Windows 11 24H2" ;SearchString="Cumulative Update for Windows 11 Version 24H2 for x64-based Systems" ;SSUSearchString=$null ; ID="Windows 11"}
$Products+=@{Product="Windows 11 23H2" ;SearchString="Cumulative Update for Windows 11 Version 23H2 for x64-based Systems" ;SSUSearchString=$null ; ID="Windows 11"}
$Products+=@{Product="Windows 11 22H2" ;SearchString="Cumulative Update for Windows 11 Version 22H2 for x64-based Systems" ;SSUSearchString=$null ; ID="Windows 11"}
$Products+=@{Product="Windows 10 21H2" ;SearchString="Cumulative Update for Windows 10 Version 21H2 for x64-based Systems" ;SSUSearchString="Servicing Stack Update for Windows 10 Version 21H2 for x64-based Systems" ; ID="Windows 10, version 1903 and later, Windows 10 LTSB"} #SSU no longer required but remain for compat reasons
Expand Down

0 comments on commit 5ad7331

Please sign in to comment.