Hi
I’m have been given many different servers using different images(some older some more recent)
as beginning I’m trying to use dsc to configure three servers(later about 30 servers) to make sure that some have hyper-v and not iis and some I want both
and all have snmp(for monitoring) installed before I even check for the two other windows features.
will something like this work for me(it seem to work I’m just not sure my dependson is right):
$ConfigurationData = @{
AllNodes = @(
@{NodeName = ‘Demoserver1’;Role=‘Web’},
@{NodeName = ‘DemoServer2’;Role=‘Hyper-V’}
@{NodeName = ‘DemoServer3’;Role=‘Hyper-V’,‘web’}
)
}
configuration RoleConfiguration
{
param ($Roles)
switch ($Roles)
{
'Hyper-V' {
WindowsFeature FileSharing
{
Name = 'Hyper-V'
}
}
'Web' {
WindowsFeature Web
{
Name = 'web-Server'
Ensure = 'absent'
}
}
}
}
configuration ExtraConfig
{
node $allnodes.NodeName
{
WindowsFeature snmp
{
Name = ‘SNMP-Service’
}
RoleConfiguration MyServerRoles
{
Roles = $Node.Role
}
}
}
configuration ExtraConfig
{
node $allnodes.NodeName
{
WindowsFeature snmp
{
Name = ‘SNMP-Service’
}
RoleConfiguration MyRoles
{
Roles = $Node.Role
DependsOn = '[WindowsFeature]snmp'
}
}
}
Thanks