Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit 793fa0e

Browse files
v4.21.0
1 parent e3f184f commit 793fa0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3267
-1278
lines changed

Configurations/Implement-Windows-Server-DHCP-2016/VMConfiguration.ps1

Lines changed: 562 additions & 531 deletions
Large diffs are not rendered by default.

Configurations/Implement-Windows-Server-DHCP-2016/VMConfigurationData.psd1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,12 @@ WIN10_x86_Enterprise_LTSC_EN_Eval x86 ISO Windows 10 32bit Enterprise L
200200
)
201201
DSCResource = @(
202202
## Download published version from the PowerShell Gallery or Github
203+
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery' },
203204
@{ Name = 'xActiveDirectory'; RequiredVersion = "3.0.0.0"; Provider = 'PSGallery' },
204205
@{ Name = 'xComputerManagement'; RequiredVersion = '4.1.0.0'; Provider = 'PSGallery' },
205206
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery' },
206207
@{ Name = 'xDhcpServer'; RequiredVersion = '3.0.0'; Provider = 'PSGallery' },
207208
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery' },
208-
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery' },
209-
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery' },
210209
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery' }
211210
)
212211
Resource = @(

Configurations/Implement-Windows-Server-DHCP-2016/VMValidate.test.ps1

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $prefix = $Labdata.NonNodeData.Lability.EnvironmentPrefix
1515
$all = @()
1616

1717
Describe DC1 {
18-
18+
1919
$VMName = "$($prefix)DC1"
2020
Try {
2121
$dc = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
@@ -162,6 +162,18 @@ Describe S1 {
162162
Describe Cli1 {
163163

164164
$VMName = "$($prefix)Cli1"
165+
$rsat = @(
166+
'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0',
167+
'Rsat.BitLocker.Recovery.Tools~~~~0.0.1.0',
168+
'Rsat.CertificateServices.Tools~~~~0.0.1.0',
169+
'Rsat.DHCP.Tools~~~~0.0.1.0',
170+
'Rsat.Dns.Tools~~~~0.0.1.0',
171+
'Rsat.FailoverCluster.Management.Tools~~~~0.0.1.0',
172+
'Rsat.FileServices.Tools~~~~0.0.1.0',
173+
'Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0',
174+
'Rsat.IPAM.Client.Tools~~~~0.0.1.0',
175+
'Rsat.ServerManager.Tools~~~~0.0.1.0'
176+
)
165177
Try {
166178

167179
$cl = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
@@ -179,11 +191,11 @@ Describe Cli1 {
179191
$i.ipv4Address | Should be '192.168.3.100'
180192
}
181193

182-
It "[CLI1]] Should have RSAT installed" {
183-
$pkg = Invoke-Command {Get-WindowsCapability -online -name *rsat*} -session $cl
184-
194+
$pkg = Invoke-Command { $using:rsat | foreach-object {Get-WindowsCapability -Online -Name $_}} -Session $cl
195+
$rsatstatus = "{0}/{1}" -f ($pkg.where({$_.state -eq "installed"}).Name).count,$rsat.count
196+
It "[Cli1] Should have RSAT installed [$rsatStatus]" {
185197
# write-host ($pkg | Select-object Name,Displayname,State | format-list | Out-String) -ForegroundColor cyan
186-
$pkg | Where-Object { $_.state -ne "installed"} | Should be $Null
198+
$pkg | Where-Object { $_.state -ne "installed" } | Should be $Null
187199
}
188200

189201
$dns = Invoke-Command {Get-DnsClientServerAddress -InterfaceAlias ethernet -AddressFamily IPv4} -session $cl

Configurations/Jason-DSC-Env/VMConfiguration.ps1

Lines changed: 64 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Configuration AutoLab {
2626
Import-DSCResource -ModuleName 'xDhcpServer' -ModuleVersion '3.0.0'
2727
Import-DSCResource -ModuleName 'xWindowsUpdate' -ModuleVersion '2.8.0.0'
2828
Import-DSCResource -ModuleName 'xPSDesiredStateConfiguration' -ModuleVersion '9.1.0'
29-
Import-DSCResource -ModuleName 'xPendingReboot' -ModuleVersion '0.4.0.0'
3029
Import-DSCResource -ModuleName 'xADCSDeployment' -ModuleVersion '1.4.0.0'
3130

3231

@@ -315,29 +314,72 @@ Configuration AutoLab {
315314
#endregion
316315
#region RSAT config
317316
node $AllNodes.Where( {$_.Role -eq 'RSAT'}).NodeName {
318-
# Adds RSAT which is now a Windows Capability in Windows 10
319317

320318
Script RSAT {
321-
TestScript = {
322-
$packages = Get-WindowsCapability -online -Name Rsat*
323-
if ($packages.state -match "Installed") {
324-
Return $True
325-
}
326-
else {
327-
Return $False
328-
}
329-
}
330-
331-
GetScript = {
332-
$packages = Get-WindowsCapability -online -Name Rsat* | Select-Object Displayname, State
333-
$installed = $packages.Where({$_.state -eq "Installed"})
334-
Return @{Result = "$($installed.count)/$($packages.count) RSAT features installed"}
335-
}
336-
337-
SetScript = {
338-
Get-WindowsCapability -online -Name Rsat* | Where-Object {$_.state -ne "installed"} | Add-WindowsCapability -online
339-
}
340-
}
319+
# Adds RSAT which is now a Windows Capability in Windows 10
320+
TestScript = {
321+
$rsat = @(
322+
'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0',
323+
'Rsat.BitLocker.Recovery.Tools~~~~0.0.1.0',
324+
'Rsat.CertificateServices.Tools~~~~0.0.1.0',
325+
'Rsat.DHCP.Tools~~~~0.0.1.0',
326+
'Rsat.Dns.Tools~~~~0.0.1.0',
327+
'Rsat.FailoverCluster.Management.Tools~~~~0.0.1.0',
328+
'Rsat.FileServices.Tools~~~~0.0.1.0',
329+
'Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0',
330+
'Rsat.IPAM.Client.Tools~~~~0.0.1.0',
331+
'Rsat.ServerManager.Tools~~~~0.0.1.0'
332+
)
333+
$packages = $rsat | ForEach-Object { Get-WindowsCapability -Online -Name $_ }
334+
if ($packages.state -contains "NotPresent") {
335+
Return $False
336+
}
337+
else {
338+
Return $True
339+
}
340+
} #test
341+
342+
GetScript = {
343+
$rsat = @(
344+
'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0',
345+
'Rsat.BitLocker.Recovery.Tools~~~~0.0.1.0',
346+
'Rsat.CertificateServices.Tools~~~~0.0.1.0',
347+
'Rsat.DHCP.Tools~~~~0.0.1.0',
348+
'Rsat.Dns.Tools~~~~0.0.1.0',
349+
'Rsat.FailoverCluster.Management.Tools~~~~0.0.1.0',
350+
'Rsat.FileServices.Tools~~~~0.0.1.0',
351+
'Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0',
352+
'Rsat.IPAM.Client.Tools~~~~0.0.1.0',
353+
'Rsat.ServerManager.Tools~~~~0.0.1.0'
354+
)
355+
$packages = $rsat | ForEach-Object { Get-WindowsCapability -Online -Name $_ } | Select-Object Displayname, State
356+
$installed = $packages.Where({ $_.state -eq "Installed" })
357+
Return @{Result = "$($installed.count)/$($packages.count) RSAT features installed" }
358+
} #get
359+
360+
SetScript = {
361+
$rsat = @(
362+
'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0',
363+
'Rsat.BitLocker.Recovery.Tools~~~~0.0.1.0',
364+
'Rsat.CertificateServices.Tools~~~~0.0.1.0',
365+
'Rsat.DHCP.Tools~~~~0.0.1.0',
366+
'Rsat.Dns.Tools~~~~0.0.1.0',
367+
'Rsat.FailoverCluster.Management.Tools~~~~0.0.1.0',
368+
'Rsat.FileServices.Tools~~~~0.0.1.0',
369+
'Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0',
370+
'Rsat.IPAM.Client.Tools~~~~0.0.1.0',
371+
'Rsat.ServerManager.Tools~~~~0.0.1.0'
372+
)
373+
foreach ($item in $rsat) {
374+
$pkg = Get-WindowsCapability -Online -Name $item
375+
if ($item.state -ne 'Installed') {
376+
Add-WindowsCapability -Online -Name $item
377+
}
378+
}
379+
380+
} #set
381+
382+
} #rsat script resource
341383

342384
}#end RSAT Config
343385
#endregion

Configurations/Jason-DSC-Env/VMConfigurationData.psd1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ WIN10_x86_Enterprise_LTSC_EN_Eval x86 ISO Windows 10 32bit Enterprise L
211211
@{ Name = 'xDhcpServer'; RequiredVersion = '3.0.0'; Provider = 'PSGallery' },
212212
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery' },
213213
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery' },
214-
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery' },
215214
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery' }
216215

217216
)

Configurations/Jason-DSC-Env/VMValidate.test.ps1

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,18 @@ Describe PullServer {
215215
Describe Cli1 {
216216

217217
$VMName = "$($prefix)Cli1"
218+
$rsat = @(
219+
'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0',
220+
'Rsat.BitLocker.Recovery.Tools~~~~0.0.1.0',
221+
'Rsat.CertificateServices.Tools~~~~0.0.1.0',
222+
'Rsat.DHCP.Tools~~~~0.0.1.0',
223+
'Rsat.Dns.Tools~~~~0.0.1.0',
224+
'Rsat.FailoverCluster.Management.Tools~~~~0.0.1.0',
225+
'Rsat.FileServices.Tools~~~~0.0.1.0',
226+
'Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0',
227+
'Rsat.IPAM.Client.Tools~~~~0.0.1.0',
228+
'Rsat.ServerManager.Tools~~~~0.0.1.0'
229+
)
218230
Try {
219231
$cl = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
220232
$all += $cl
@@ -229,12 +241,13 @@ Describe Cli1 {
229241
$i.ipv4Address | Should be '192.168.3.100'
230242
}
231243

232-
It "[CLI1] Should have RSAT installed" {
233-
$pkg = Invoke-Command {Get-WindowsCapability -online -name *rsat*} -session $cl
234-
244+
$pkg = Invoke-Command { $using:rsat | foreach-object {Get-WindowsCapability -Online -Name $_}} -Session $cl
245+
$rsatstatus = "{0}/{1}" -f ($pkg.where({$_.state -eq "installed"}).Name).count,$rsat.count
246+
It "[CLI1] Should have RSAT installed [$rsatStatus]" {
235247
# write-host ($pkg | Select-object Name,Displayname,State | format-list | Out-String) -ForegroundColor cyan
236-
$pkg | Where-Object { $_.state -ne "installed"} | Should be $Null
248+
$pkg | Where-Object { $_.state -ne "installed" } | Should be $Null
237249
}
250+
238251
$dns = Invoke-Command {Get-DnsClientServerAddress -InterfaceAlias ethernet -AddressFamily IPv4} -session $cl
239252
It "[CLI1] Should have a DNS server configuration of 192.168.3.10" {
240253
$dns.ServerAddresses -contains '192.168.3.10' | Should Be "True"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[
2+
{
3+
"DistinguishedName": "CN=IT,OU=IT,DC=Company,DC=Pri",
4+
"Name": "IT",
5+
"GroupCategory": "Security",
6+
"GroupScope": "Global",
7+
"Members": [
8+
"MikeS",
9+
"MaryL"
10+
]
11+
},
12+
{
13+
"DistinguishedName": "CN=Sales,OU=Sales,DC=Company,DC=Pri",
14+
"Name": "Sales",
15+
"GroupCategory": "Security",
16+
"GroupScope": "Global",
17+
"Members": [
18+
"SamanthaS",
19+
"SonyaS",
20+
"SamS"
21+
]
22+
},
23+
{
24+
"DistinguishedName": "CN=Marketing,OU=Marketing,DC=Company,DC=Pri",
25+
"Name": "Marketing",
26+
"GroupCategory": "Security",
27+
"GroupScope": "Global",
28+
"Members": [
29+
"MattS",
30+
"MonicaS",
31+
"MarkS"
32+
]
33+
},
34+
{
35+
"DistinguishedName": "CN=Accounting,OU=Accounting,DC=Company,DC=Pri",
36+
"Name": "Accounting",
37+
"GroupCategory": "Security",
38+
"GroupScope": "Global",
39+
"Members": [
40+
"AaronS",
41+
"AndreaS",
42+
"AndyS"
43+
]
44+
},
45+
{
46+
"DistinguishedName": "CN=JEA Operators,OU=JEA_Operators,DC=Company,DC=Pri",
47+
"Name": "JEA Operators",
48+
"GroupCategory": "Security",
49+
"GroupScope": "Global",
50+
"Members": [
51+
"JimJ",
52+
"JillJ"
53+
]
54+
}
55+
56+
]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[
2+
{
3+
"Name": "IT",
4+
"Description": null
5+
},
6+
{
7+
"Name": "Dev",
8+
"Description": null
9+
},
10+
{
11+
"Name": "Marketing",
12+
"Description": null
13+
},
14+
{
15+
"Name": "Sales",
16+
"Description": null
17+
},
18+
{
19+
"Name": "Accounting",
20+
"Description": null
21+
},
22+
{
23+
"Name": "JEA_Operators",
24+
"Description": null
25+
},
26+
{
27+
"Name": "Servers",
28+
"Description": null
29+
}
30+
31+
]

0 commit comments

Comments
 (0)