Desired State Configuration

Another great way of not only deploying new configurations, but also ensuring they remain configured as you intended, is Desired State Configuration. We will delve into this in more detail in a later chapter. The following configuration could be used to deploy our samples. You need at least PowerShell 5 to use the JEA DSC resource:

# Deployment with DSC
configuration JeaEndpointConfiguration
{
param
(
[string[]]$ComputerName
)
Import-DscResource -ModuleName JustEnoughAdministration

node $ComputerName
{

File RoleCapabilities
{
SourcePath = '\contoso.comReadOnlyShareJeaCapabilities'
DestinationPath = (Join-Path ($env:PSModulePath -split ';')[1] 'JeaCapabilities')
Ensure = 'Present'
Recurse = $true
Force = $true
}

JeaEndpoint EndpointConfiguration
{
EndpointName = 'SupportSession'
RoleDefinitions = '@{"contosoFirstLevelSupport" = @{RoleCapabilities = "FirstLevelUserSupport"}}'
DependsOn = '[File]RoleCapabilities'
Ensure = 'Present'
TranscriptDirectory = 'C:Transcripts'
}
}
}

# Create MOF files and start configuration
JeaEndpointConfiguration -ComputerName (1..10 | % { "Node$_"})
Start-DscConfiguration -Path .JeaEndpointConfiguration -Wait -Verbose

Desired State Configuration ensures that the role capabilities files are present and unchanged, and that the endpoint is registered and configured.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.144.197