Skip to content
Merged

Dev #620

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Scripts/0_DCHydrate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ function Hydrate-DC {
[parameter(Mandatory=$true)]
[string]$DhcpScope,

[parameter(Mandatory=$true)]
[string]$DhcpScopeState,

[parameter(Mandatory=$true)]
[string]$AdminPassword)

Expand Down Expand Up @@ -396,8 +399,8 @@ function Hydrate-DC {
IPEndRange = ($DhcpScope+"254")
Name = 'ManagementScope'
SubnetMask = '255.255.255.0'
LeaseDuration = '00:08:00'
State = 'Active'
LeaseDuration = ((New-TimeSpan -Hours 8).ToString())
State = $DHCPScopeState
AddressFamily = 'IPv4'
DependsOn = "[Service]DHCPServer"
}
Expand Down
12 changes: 11 additions & 1 deletion Scripts/3_Deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,16 @@ If (-not $isAdmin) {
$LabConfig.DHCPscope="10.0.0.0"
}

if (!$LabConfig.DHCPscopeActive){
$DHCPScopeState = 'Active'
}
elseif ($LabConfig.DHCPscopeActive -eq $false){
$DHCPScopeState = 'Inactive'
}
else {
$DHCPScopeState = 'Active'
}

WriteInfoHighlighted "List of variables used"
WriteInfo "`t Prefix used in lab is $($labconfig.prefix)"

Expand Down Expand Up @@ -1287,7 +1297,7 @@ If (-not $isAdmin) {
$VMPath="$PSScriptRoot\LAB\"
$HydrationSwitchname="DC_HydrationSwitch_$([guid]::NewGuid())"

Hydrate-DC -DCName $DCName -VhdPath $vhdpath -VMPath $VMPath -Switchname $HydrationSwitchname -TimeZone $TimeZone -DHCPScope $LabConfig.DHCPscope -AdminPassword $LabConfig.AdminPassword
Hydrate-DC -DCName $DCName -VhdPath $vhdpath -VMPath $VMPath -Switchname $HydrationSwitchname -TimeZone $TimeZone -DHCPScope $LabConfig.DHCPscope -DHCPScopeState $DHCPScopeState -AdminPassword $LabConfig.AdminPassword
$DC=Get-VM -Name $DCName
if ($DC -eq $null){
WriteErrorAndExit "DC was not created successfully Press any key to continue ..."
Expand Down
1 change: 1 addition & 0 deletions Scripts/LabConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ $LabConfig=@{AllowedVLANs="1-10,711-719" ; DomainAdminName='LabAdmin'; AdminPass
EnableGuestServiceInterface=$false; # (Optional) If True, then Guest Services integration component will be enabled on all VMs.
DCVMProcessorCount=2; # (Optional) 2 is default. If specified more/less, processorcount will be modified.
DHCPscope="10.0.0.0"; # (Optional) 10.0.0.0 is configured if nothing is specified. Scope has to end with .0 (like 10.10.10.0). It's always /24
DHCPscopeActive=$true; # (Optional) If set to $false, DHCP Scope is created, but set to 'Inactive'
DCVMVersion="9.0"; # (Optional) Latest is used if nothing is specified. Make sure you use values like "8.0","8.3","9.0"
TelemetryLevel=""; # (Optional) If configured, script will stop prompting you for telemetry. Values are "None","Basic","Full"
TelemetryNickname=""; # (Optional) If configured, telemetry will be sent with NickName to correlate data to specified NickName. So when leaderboards will be published, MSLab users will be able to see their own stats
Expand Down