This repository was archived by the owner on Aug 25, 2024. It is now read-only.
forked from adbertram/TestDomainCreator
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDscTemplate.ps1
60 lines (50 loc) · 1.85 KB
/
DscTemplate.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Configuration DscConfiguration {
Import-DscResource -Module cChoco
Import-DscResource -ModuleName NetworkingDsc
Import-DscResource -Module PSDscResources
Import-DscResource -Module xRemoteDesktopAdmin
Import-DscResource -Module xWindowsUpdate
Node TEMPLATE {
LocalConfigurationManager {
ConfigurationMode = 'ApplyAndAutoCorrect'
ConfigurationModeFrequencyMins = 30
RefreshMode = 'Push'
RebootNodeIfNeeded = $False
}
$FirewallRules = @(
'FPS-ICMP4-ERQ-In' # allow ping
'FPS-SMB-In-TCP' # allow smb shares
'RemoteSvcAdmin-RPCSS-In-TCP' # allow Veeam RPC
'RemoteDesktop-UserMode-In-TCP' # allow RDP
)
Foreach ($Rule in $FirewallRules) {
Firewall $Rule {
Name = $Rule
Ensure = 'Present'
Enabled = 'True'
Profile = ('Domain', 'Private')
}
}
cChocoInstaller InstallChoco {
InstallDir = "c:\ProgramData\Chocolatey"
}
cChocoPackageInstaller firefox {
Name = 'firefox'
Ensure = 'Present'
AutoUpgrade = $True
DependsOn = "[cChocoInstaller]installChoco"
}
xWindowsUpdateAgent MuSecurityImportant {
IsSingleInstance = 'Yes'
UpdateNow = $false
Category = @('Security', 'Important')
Source = 'MicrosoftUpdate'
Notifications = 'Disabled'
}
xRemoteDesktopAdmin RemoteDesktopSettings {
Ensure = 'Present'
UserAuthentication = 'Secure'
}
}
}
DscConfiguration -OutputPath $ENV:UserProfile\DSC -ConfigurationData .\configData.psd1