Skip to content

Commit

Permalink
Merge branch 'release-5.40'
Browse files Browse the repository at this point in the history
  • Loading branch information
nyanhp committed Oct 13, 2021
2 parents dca9f19 + 10a350e commit 29f281a
Show file tree
Hide file tree
Showing 24 changed files with 1,264 additions and 80 deletions.
12 changes: 11 additions & 1 deletion Assets/ProductKeys.xml
Expand Up @@ -117,5 +117,15 @@
<ProductKey OperatingSystemName="Windows Server 2022 Datacenter Evaluation" Key="WX4NM-KYWYW-QJJR4-XV3QB-6VM33" Version="10.0.17763.107" />
<ProductKey OperatingSystemName="Windows Server 2022 Datacenter Evaluation (Desktop Experience)" Key="WX4NM-KYWYW-QJJR4-XV3QB-6VM33" Version="10.0.17763.107" />


<!-- Win 11-->
<ProductKey OperatingSystemName="Windows 11 Pro" Key="W269N-WFGWX-YVC9B-4J6C9-T83GX" Version="10.0.17134.1" />
<ProductKey OperatingSystemName="Windows 11 Pro for Workstations" Key="NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J" Version="10.0.17134.1" />
<ProductKey OperatingSystemName="Windows 11 Pro N" Key="W269N-WFGWX-YVC9B-4J6C9-T83GX" Version="10.0.17134.1" />
<ProductKey OperatingSystemName="Windows 11 Pro for Workstations N" Key="NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J" Version="10.0.17134.1" />
<ProductKey OperatingSystemName="Windows 11 Education" Key="NW6C2-QMPVW-D7KKK-3GKT6-VCFB2" Version="10.0.17134.1" />
<ProductKey OperatingSystemName="Windows 11 Pro Education" Key="6TP4R-GNPTD-KYYHQ-7B7DP-J447Y" Version="10.0.17134.1" />
<ProductKey OperatingSystemName="Windows 11 Pro Education N" Key="6TP4R-GNPTD-KYYHQ-7B7DP-J447Y" Version="10.0.17134.1" />
<ProductKey OperatingSystemName="Windows 11 Education N" Key="6TP4R-GNPTD-KYYHQ-7B7DP-J447Y" Version="10.0.17134.1" />
<ProductKey OperatingSystemName="Windows 11 Enterprise" Key="NPPR9-FWDCX-D2C8J-H872K-2YT43" Version="10.0.17134.1" />
<ProductKey OperatingSystemName="Windows 11 Enterprise N" Key="NPPR9-FWDCX-D2C8J-H872K-2YT43" Version="10.0.17134.1" />
</ListXmlStoreOfProductKey>
24 changes: 22 additions & 2 deletions AutomatedLab/AutomatedLab.init.ps1
Expand Up @@ -314,13 +314,21 @@ Set-PSFConfig -Module AutomatedLab -Name SqlClrType2016 -Value "https://download
Set-PSFConfig -Module AutomatedLab -Name SqlClrType2019 -Value "https://download.microsoft.com/download/d/d/1/dd194c5c-d859-49b8-ad64-5cbdcbb9b7bd/SQLSysClrTypes.msi" -Initialize -Validation string
Set-PSFConfig -Module AutomatedLab -Name SqlSmo2016 -Value "https://download.microsoft.com/download/6/4/5/645B2661-ABE3-41A4-BC2D-34D9A10DD303/ENU/x64/SharedManagementObjects.msi" -Initialize -Validation string
Set-PSFConfig -Module AutomatedLab -Name Dynamics365Uri -Value 'https://download.microsoft.com/download/B/D/0/BD0FA814-9885-422A-BA0E-54CBB98C8A33/CRM9.0-Server-ENU-amd64.exe' -Initialize -Validation String
#Set-PSFConfig -Module AutomatedLab -Name -Uri 'https://download.microsoft.com/download/6/4/5/645B2661-ABE3-41A4-BC2D-34D9A10DD303/ENU/x64/msodbcsql.msi'

# Exchange Server
Set-PSFConfig -Module AutomatedLab -Name Exchange2013DownloadUrl -Value 'https://download.microsoft.com/download/7/F/D/7FDCC96C-26C0-4D49-B5DB-5A8B36935903/Exchange2013-x64-cu23.exe'
Set-PSFConfig -Module AutomatedLab -Name Exchange2016DownloadUrl -Value 'https://download.microsoft.com/download/7/d/5/7d5c319b-510b-4a2c-a77a-099c6f30ab54/ExchangeServer2016-x64-CU21.ISO'
Set-PSFConfig -Module AutomatedLab -Name Exchange2019DownloadUrl -Value 'https://download.microsoft.com/download/7/3/f/73f75f9e-e7fd-4cb0-a2fc-405cbb800f2d/ExchangeServer2019-x64-CU10.ISO'

# ConfigMgr
Set-PSFConfig -Module AutomatedLab -Name ConfigurationManagerWmiExplorer -Value 'https://github.com/vinaypamnani/wmie2/releases/download/v2.0.0.2/WmiExplorer_2.0.0.2.zip'
Set-PSFConfig -Module AutomatedLab -Name ConfigurationManagerUrl1902CB -Value 'http://download.microsoft.com/download/1/B/C/1BCADBD7-47F6-40BB-8B1F-0B2D9B51B289/SC_Configmgr_SCEP_1902.exe'
Set-PSFConfig -Module AutomatedLab -Name ConfigurationManagerUrl1902TP -Value 'http://download.microsoft.com/download/1/B/C/1BCADBD7-47F6-40BB-8B1F-0B2D9B51B289/SC_Configmgr_SCEP_1902.exe'
Set-PSFConfig -Module AutomatedLab -Name ConfigurationManagerUrl2002CB -Value "https://download.microsoft.com/download/e/0/a/e0a2dd5e-2b96-47e7-9022-3030f8a1807b/MEM_Configmgr_2002.exe"
Set-PSFConfig -Module AutomatedLab -Name ConfigurationManagerUrl2002TP -Value "https://download.microsoft.com/download/D/8/E/D8E795CE-44D7-40B7-9067-D3D1313865E5/Configmgr_TechPreview2010.exe"
Set-PSFConfig -Module AutomatedLab -Name ConfigurationManagerUrl2103CB -Value "https://download.microsoft.com/download/8/8/8/888d525d-5523-46ba-aca8-4709f54affa8/MEM_Configmgr_2103.exe"
Set-PSFConfig -Module AutomatedLab -Name ConfigurationManagerUrl2103TP -Value "https://download.microsoft.com/download/D/8/E/D8E795CE-44D7-40B7-9067-D3D1313865E5/Configmgr_TechPreview2103.exe"

# Validation
Set-PSFConfig -Module AutomatedLab -Name ValidationSettings -Value @{
ValidRoleProperties = @{
Expand Down Expand Up @@ -707,6 +715,17 @@ Set-PSFConfig -Module AutomatedLab -Name ValidationSettings -Value @{
RemoteDesktopLicensing = @(
'Mode'
)
ConfigurationManager = @(
'Version'
'Branch'
'Roles'
'SiteName'
'SiteCode'
'SqlServerName'
'DatabaseName'
'WsusContentPath'
'AdminUser'
)
}
MandatoryRoleProperties = @{
ADFSProxy = @(
Expand Down Expand Up @@ -797,7 +816,8 @@ Register-PSFTeppArgumentCompleter -Command Send-ALNotification -Parameter Provid
Register-PSFTeppArgumentCompleter -Command Add-LabAzureSubscription -Parameter SubscriptionName -Name 'AutomatedLab-Subscription'
Register-PSFTeppArgumentCompleter -Command Get-LabPostInstallationActivity -Parameter CustomRole -Name 'AutomatedLab-CustomRole'
Register-PSFTeppArgumentCompleter -Command Add-LabMachineDefinition -Parameter AzureRoleSize -Name 'AutomatedLab-AzureRoleSize'
Register-PSFTeppArgumentCompleter -Command Add-LabMachineDefinition -Parameter TimeZone -Name 'AutomatedLab-TimeZone'
Register-PSFTeppArgumentCompleter -Command Add-LabMachineDefinition, Enable-LabMachineAutoShutdown -Parameter TimeZone -Name 'AutomatedLab-TimeZone'
Register-PSFTeppArgumentCompleter -Command Add-LabAzureSubscription -Parameter AutoShutdownTimeZone -Name 'AutomatedLab-TimeZone'
Register-PSFTeppArgumentCompleter -Command Add-LabMachineDefinition -Parameter RhelPackage -Name 'AutomatedLab-RhelPackage'
Register-PSFTeppArgumentCompleter -Command Add-LabMachineDefinition -Parameter SusePackage -Name 'AutomatedLab-SusePackage'
#endregion
6 changes: 4 additions & 2 deletions AutomatedLab/AutomatedLab.psd1
Expand Up @@ -54,7 +54,8 @@
'AutomatedLabScvmm.psm1',
'AutomatedLabScom.psm1'
'AutomatedLabDynamics.psm1',
'AutomatedLabRds.psm1'
'AutomatedLabRds.psm1',
'AutomatedLabConfigurationManager.psm1'
)

RequiredModules = @(
Expand Down Expand Up @@ -158,7 +159,8 @@
'Install-LabWindowsAdminCenter',
'Install-LabScom',
'Install-LabDynamics',
'Install-LabRemoteDesktopServices'
'Install-LabRemoteDesktopServices',
'Install-LabConfigurationManager',
'Add-LabWacManagedNode',
'Invoke-LabCommand',
'Invoke-LabDscConfiguration',
Expand Down
31 changes: 27 additions & 4 deletions AutomatedLab/AutomatedLab.psm1
Expand Up @@ -615,7 +615,19 @@ function Export-Lab
Remove-Item -Path $lab.DiskDefinitionFiles[0].Path

$lab.Machines.Export($lab.MachineDefinitionFiles[0].Path)
$lab.Disks.Export($lab.DiskDefinitionFiles[0].Path)
try
{
$lab.Disks.Export($lab.DiskDefinitionFiles[0].Path)
}
catch
{
$tmpList = [AutomatedLab.ListXmlStore[AutomatedLab.Disk]]::new()
foreach ($d in $lab.Disks)
{
$tmpList.Add($d)
}
$tmpList.Export($lab.DiskDefinitionFiles[0].Path)
}
$lab.Machines.Clear()
$lab.Disks.Clear()

Expand Down Expand Up @@ -704,7 +716,6 @@ function Install-Lab
[switch]$CA,
[switch]$ADFS,
[switch]$DSCPullServer,
[switch]$ConfigManager2012R2,
[switch]$VisualStudio,
[switch]$Office2013,
[switch]$Office2016,
Expand All @@ -719,6 +730,7 @@ function Install-Lab
[switch]$Scom,
[switch]$Dynamics,
[switch]$RemoteDesktop,
[switch]$ConfigurationManager,
[switch]$StartRemainingMachines,
[switch]$CreateCheckPoints,
[switch]$InstallRdsCertificates,
Expand Down Expand Up @@ -886,6 +898,8 @@ function Install-Lab

Write-ScreenInfo -Message "Machines with RootDC role to be installed: '$((Get-LabVM -Role RootDC).Name -join ', ')'"
Install-LabRootDcs -CreateCheckPoints:$CreateCheckPoints

New-LabADSubnet

# Set account expiration for builtin account and lab domain account
foreach ($machine in (Get-LabVM -Role RootDC -ErrorAction SilentlyContinue))
Expand Down Expand Up @@ -1054,6 +1068,15 @@ function Install-Lab
Write-ScreenInfo -Message 'Done' -TaskEnd
}

if (($ConfigurationManager -or $performAll) -and (Get-LabVm -Role ConfigurationManager -Filter {-not $_.SkipDeployment}))
{
Write-ScreenInfo -Message 'Deploying System Center Configuration Manager' -TaskStart
$jobs = Invoke-LabCommand -PreInstallationActivity -ActivityName 'Pre-installation' -ComputerName $(Get-LabVM -Role ConfigurationManager | Where-Object { -not $_.SkipDeployment }) -PassThru -NoDisplay
$jobs | Where-Object { $_ -is [System.Management.Automation.Job] } | Wait-Job | Out-Null
Install-LabConfigurationManager
Write-ScreenInfo -Message 'Done' -TaskEnd
}

if (($RemoteDesktop -or $performAll) -and (Get-LabVm -Role RDS -Filter {-not $_.SkipDeployment}))
{
Write-ScreenInfo -Message 'Deploying Remote Desktop Services' -TaskStart
Expand Down Expand Up @@ -1281,7 +1304,7 @@ function Install-Lab
Start-LabVM -All -DelayBetweenComputers $DelayBetweenComputers -ProgressIndicator 30 -TimeoutInMinutes $timeoutRemaining -Wait

$userName = (Get-Lab).DefaultInstallationCredential.UserName
$nonDomainControllers = Get-LabVM -Filter { $_.Roles.Name -notcontains 'RootDc' -and $_.RolesName -notcontains 'DC' -and $_.RolesName -notcontains 'FirstChildDc' }
$nonDomainControllers = Get-LabVM -Filter { $_.Roles.Name -notcontains 'RootDc' -and $_.Roles.Name -notcontains 'DC' -and $_.Roles.Name -notcontains 'FirstChildDc' -and -not $_.SkipDeployment }
if ($nonDomainControllers) {
Invoke-LabCommand -ActivityName 'Setting PasswordNeverExpires for local deployment accounts' -ComputerName $nonDomainControllers -ScriptBlock {
# Still supporting ANCIENT server 2008 R2 with it's lack of CIM cmdlets :'(
Expand Down Expand Up @@ -3267,7 +3290,7 @@ function Show-LabDeploymentSummary
}

Write-ScreenInfo -Message '------------------------- Virtual Machine Summary -------------------------'
$vmInfo = Get-LabVM -IncludeLinux | Format-Table -Property Name, DomainName, IpAddress, Roles, OperatingSystem,
$vmInfo = Get-LabVM -IncludeLinux | Format-Table -Property Name, DomainName, IpV4Address, Roles, OperatingSystem,
@{ Name = 'Local Admin'; Expression = { $_.InstallationUser.UserName } },
@{ Name = 'Password'; Expression = { $_.InstallationUser.Password } } -AutoSize |
Out-String
Expand Down
13 changes: 12 additions & 1 deletion AutomatedLab/AutomatedLabADDS.psm1
Expand Up @@ -2024,7 +2024,18 @@ function New-LabADSubnet
foreach ($machine in $machines)
{
$ipAddress = ($machine.IpAddress -split '/')[0]
$subnetMask = ($machine.IpAddress -split '/')[1] | ConvertTo-Mask

if ($ipAddress -eq '0.0.0.0') {
$ipAddress = Get-NetIPAddress -AddressFamily IPv4 | Where-Object InterfaceAlias -eq "vEthernet ($($machine.Network))"
}
$ipPrefix = ($machine.IpAddress -split '/')[1]
$subnetMask = if ([int]$ipPrefix) {
$ipPrefix | ConvertTo-Mask
}
else {
$ipAddress.PrefixLength | ConvertTo-Mask
$ipAddress = $ipAddress.IPAddress
}

$networkInfo = Get-NetworkSummary -IPAddress $ipAddress -SubnetMask $subnetMask
Write-PSFMessage -Message "Creating subnet '$($networkInfo.Network)' with mask '$($networkInfo.MaskLength)' on machine '$($machine.Name)'"
Expand Down
2 changes: 1 addition & 1 deletion AutomatedLab/AutomatedLabAzure.psm1
Expand Up @@ -88,7 +88,7 @@ function Add-LabAzureSubscription
[timespan]
$AutoShutdownTime,

[TimeZoneInfo]
[string]
$AutoShutdownTimeZone,

[switch]$PassThru,
Expand Down

0 comments on commit 29f281a

Please sign in to comment.