Skip to content

Commit 9ffe266

Browse files
authored
Merge pull request #598 from microsoft/dev
network isolation fix
2 parents 0e85235 + dc61e06 commit 9ffe266

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

Scripts/1_Prereq.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function Get-WindowsBuildNumber {
195195
#region Downloading required Posh Modules
196196
# Downloading modules into Temp folder if needed.
197197

198-
$modules=("ActiveDirectoryDsc","6.3.0"),("xDHCPServer","3.1.1"),("DnsServerDsc","3.0.0"),("NetworkingDSC","9.0.0"),("xPSDesiredStateConfiguration","9.1.0")
198+
$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")
199199
foreach ($module in $modules){
200200
WriteInfoHighlighted "Testing if modules are present"
201201
$modulename=$module[0]

Scripts/2_CreateParentDisks.ps1

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,9 @@ If (-not $isAdmin) {
652652
New-item -type directory -Path "$mountdir\Windows\Panther" -force
653653
Copy-Item -Path $unattendfile -Destination "$mountdir\Windows\Panther\unattend.xml" -force
654654
Copy-Item -Path "$PSScriptRoot\Temp\DSC\*" -Destination "$mountdir\Program Files\WindowsPowerShell\Modules\" -Recurse -force
655+
WriteInfoHighlighted "`t Adding Hyper-V feature into DC"
656+
#Install Hyper-V feature
657+
Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Path "$mountdir"
655658

656659
#Create credentials for DSC
657660

@@ -682,9 +685,9 @@ If (-not $isAdmin) {
682685
Import-DSCResource -ModuleName NetworkingDSC -ModuleVersion "9.0.0"
683686
Import-DSCResource -ModuleName xDHCPServer -ModuleVersion "3.1.1"
684687
Import-DSCResource -ModuleName xPSDesiredStateConfiguration -ModuleVersion "9.1.0"
688+
Import-DSCResource -ModuleName xHyper-V -ModuleVersion "3.18.0"
685689
Import-DscResource -ModuleName PSDesiredStateConfiguration
686690

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

690693
{
@@ -722,13 +725,23 @@ If (-not $isAdmin) {
722725
DependsOn = "[WindowsFeature]ADDSInstall"
723726
}
724727

725-
WindowsFeature FeatureDNSTools
728+
WindowsFeature Hyper-V-PowerShell
726729
{
727730
Ensure = "Present"
728-
Name = "RSAT-DNS-Server"
729-
DependsOn = "[WindowsFeature]ADDSInstall"
730-
}
731-
731+
Name = "Hyper-V-PowerShell"
732+
}
733+
734+
xVMSwitch VMSwitch
735+
{
736+
Ensure = "Present"
737+
Name = "vSwitch"
738+
Type = "External"
739+
AllowManagementOS = $true
740+
NetAdapterName = "Ethernet"
741+
EnableEmbeddedTeaming = $true
742+
DependsOn = "[WindowsFeature]Hyper-V-PowerShell"
743+
}
744+
732745
ADDomain FirstDS
733746
{
734747
DomainName = $Node.DomainName
@@ -842,9 +855,11 @@ If (-not $isAdmin) {
842855
IPaddress IP
843856
{
844857
IPAddress = ($DHCPscope+"1/24")
845-
AddressFamily = 'IPv4'
846-
InterfaceAlias = 'Ethernet'
858+
AddressFamily = "IPv4"
859+
InterfaceAlias = "vEthernet (vSwitch)"
860+
DependsOn = "[xVMSwitch]VMSwitch"
847861
}
862+
848863
WindowsFeature DHCPServer
849864
{
850865
Ensure = "Present"
@@ -866,7 +881,6 @@ If (-not $isAdmin) {
866881
DependsOn = "[WindowsFeature]DHCPServer"
867882
}
868883

869-
870884
xDhcpServerScope ManagementScope
871885
{
872886
Ensure = 'Present'

0 commit comments

Comments
 (0)