Netherlands: Software

Introductie Windows Server 2016

Issue link:

Contents of this Issue


Page 156 of 173

147 C H A P T E R 7 | Systems management $ConfigInfoIndex = @{ AllNodes = @( @{ NodeName = "IndexFile.fcd03a8d-5a64-4982-92b3-5c89680add39" } ) } Configuration IndexFile { Node $AllNodes.NodeName { File IndexFile { DestinationPath = "C:\inetpub\wwwroot\index.htm" Ensure = "Present" Type = "File" Force = $true Contents = " Website under construction. `

If you are seeing this page, it means the website is under maintenance and DSC Rocks !!!!!

" } } } IndexFile -OutputPath 'C:\Program Files\WindowsPowerShell\DscService\Configuration' -ConfigurationData $ConfigInfoIndex New-DSCCheckSum -ConfigurationPath 'C:\Program Files\WindowsPowerShell\DscService\Configuration' -OutPath 'C:\Program Files\WindowsPowerShell\DscService\Configuration' The MOF file is generated on the pull server DemoWinServer10 at the C:\Program Files\WindowsPowerShell\DSCService\Configuration folder location. The checksum file for this configuration is also generated the same way as for the previous configuration example. Deploying the configurations After addressing LCM and relevant authoring configurations for partial configurations, you apply them on the destination server, in this case on DemoServerWin. DSC provides the Update- DSCConfiguration cmdlet in its new release for performing consistency checks on a server. Running this cmdlet with the localhost as the ComputerName parameter simultaneously downloads from the pull server all relevant configurations (MOF content) defined by using LCM PartialConfiguration. LCM then combines all the configurations into a single MOF file and applies it to the server. The following example shows the Update-DSCConfiguration cmdlet for applying configuration: PS C:\Users\me> Update-DSCConfiguration -ComputerName localhost Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 47 Job47 Configuratio... Running True localhost Update-DscConfiguration Running the Get-DSCConfiguration cmdlet on this server provides all the resources (File and WindowsFeature) applied as part of DSC configuration, as shown here: PS C:\Users\riteshmodi> Get-DSCConfiguration ConfigurationName : DependsOn : ModuleName : ModuleVersion : ResourceId : SourceInfo : Credential : DisplayName : Web Server (IIS) Ensure : Present IncludeAllSubFeature : False LogPath : Name : Web-Server Source : PSComputerName : ConfigurationName : DependsOn : ModuleName : ModuleVersion :

Articles in this issue

Archives of this issue

view archives of Netherlands: Software - Introductie Windows Server 2016