-
Notifications
You must be signed in to change notification settings - Fork 5
/
server_config.ps1
39 lines (35 loc) · 1.04 KB
/
server_config.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
Configuration BasicIIS
{
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
node localhost {
WindowsFeature Web-Server
{
Name ="Web-Server"
Ensure="Present"
}
WindowsFeature IIS {
Ensure = "Present"
Name = "Web-Mgmt-Service"
}
WindowsFeature Web-Windows-Auth {
Ensure = "Present"
Name = 'Web-Windows-Auth'
}
Service WebManagementService {
Name = "WMSVC"
StartupType = "Automatic"
State = "Running"
DependsOn = "[WindowsFeature]IIS"
}
Registry RemoteManagement {
Key = "HKLM:\SOFTWARE\Microsoft\WebManagement\Server"
ValueName = "EnableRemoteManagement"
ValueData = 1
ValueType = "Dword"
DependsOn = "[WindowsFeature]IIS"
}
}
}
BasicIIS -OutputPath .\BasicIIS
Start-DscConfiguration -Wait -Verbose -Path .\BasicIIS -Force
remove-item .\basicIIS -Force -Recurse