Netherlands: Software

Introductie Windows Server 2016

Issue link:

Contents of this Issue


Page 152 of 173

143 C H A P T E R 7 | Systems management SendConfigurationApplyAsync The SendConfigurationApplyAsync method applies the configuration to a target server asynchronously. This means LCM invokes this method and does not wait for its completion. Again, there is no DSC cmdlet to invoke this method; however, you can invoke it through a CIM cmdlet, as shown in the following example: PS C:\> Configuration PushDemo { Node DemoServerWin10 { WindowsFeature XPS { Name = "XPS-Viewer" Ensure = "Absent" } } } PushDemo -OutputPath "C:\DSC" $mofString = get-content "C:\dsc\DemoServerWin10.mof" $mofbytes = [System.Text.Encoding]::ASCII.GetBytes($mofString) $AsyncApply = Invoke-CimMethod -ClassName "MSFT_DSCLocalConfigurationManager" ` -Namespace "root\Microsoft\Windows\DesiredStateConfiguration" ` -MethodName SendConfigurationApplyAsync ` -Arguments @{ConfigurationData=$mofbytes;Force=$true} $AsyncApply Directory: C:\DSC Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 11/12/2014 2:28 PM 1226 DemoServerWin10.mof PSComputerName : DSC partial configurations One of the most awaited and interesting features of DSC v2 is partial configuration. Until DSC v2, it was difficult to split a configuration into multiple configuration files authored for a server. Partial configuration makes it possible for you to split a configuration into multiple smaller configuration fragments across multiple files. Partial configurations are implemented exactly the same as any general DSC configuration. It is the responsibility of LCM on a destination server to combine all the configuration fragments into a single configuration and apply it. Partial configurations are complete in and of themselves and can be applied independently as a complete configuration to any server. It is the way they are deployed on a pull server and the way the LCM Meta Configuration is configured on the target server that makes it possible for partial configurations to be applied to a server. In Windows Server 2016 Technical Preview, partial configurations only work with DSC pull mode. This means that you should configure the LCM of servers in a network to pull configurations from a pull server (IIS or SMB share) and be able to identify the configurations distinctly on these pull servers. The benefits of partial configurations include the following: Multiple authors can author configurations independently and simultaneously for servers in a network. You can apply incremental configurations to servers without modifying any existing configurations. Modular authoring of configurations is available. There are no longer dependencies on using only a single MOF file. This was the case in DSC v1, for which only one MOF file was allowed and applied to a server at a given point of time. Newer configuration (MOF) would replace the current configuration in DSC v1.

Articles in this issue

Archives of this issue

view archives of Netherlands: Software - Introductie Windows Server 2016