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 pathWeb-Server.ps1
73 lines (62 loc) · 2.24 KB
/
Web-Server.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
61
62
63
64
65
66
67
68
69
70
71
72
73
Configuration DscConfiguration {
Import-DscResource -Module cChoco
Import-DscResource -ModuleName NetworkingDsc
Import-DscResource -Module PSDscResources
Import-DscResource -Module xRemoteDesktopAdmin
Import-DscResource -Module xWindowsUpdate
Node $AllNodes.where( { $_.Purpose -eq 'IIS' }).NodeName {
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')
}
}
$WindowsFeatures = @(
'RSAT-AD-PowerShell'
'Web-Server'
'Web-WebSockets'
'Web-Http-Redirect'
)
Foreach ($Feature in $WindowsFeatures) {
WindowsFeature $Feature {
Ensure = 'Present'
Name = $Feature
}
}
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 .\configurationData.psd1