Netherlands: Software

Introductie Windows Server 2016

Issue link:

Contents of this Issue


Page 151 of 173

142 C H A P T E R 7 | Systems management ReportManagers : [MSFT_WebReportManager]ComplianceServer ResourceModuleManagers : {} PSComputerName : In the preceding code block, the ConfigurationDownloadManagers property is filled with two values representing two pull servers: PartialConfigurations has two values represented by the IISInstall and IndexFile configurations, and ReportManagers has a value of ComplianceServer. New methods in LCM There are three new methods in LCM v2: GetConfigurationStatus, GetConfigurationResultOutput, and SendConfigurationApplyAsync. Let's examine these briefly. GetConfigurationStatus The GetConfigurationStatus method retrieves the current status of configuration for a server. The new DSC cmdlet Get-DSCConfigurationStatus invokes the CIM method. The following code shows an example of Get-DSCConfigurationStatus: PS C:\> $cimsession = New-CimSession -ComputerName DemoServerWin10 PS C:\> Get-DscConfigurationStatus -CimSession $cimsession Status StartDate Type Mode RebootRequested NumberOfConfigurationResources PSComputerName ------ --------- ---- ---- --------------- ------------------------------ -------------- Success 2014/11/12 16:23:03 Consistency PUSH False 1 DemoServerWin10 GetConfigurationResultOutput The GetConfigurationResultOutput method provides verbose information about the current configuration and the configuration drifts. There is no DSC cmdlet that invokes this CIM method. Instead, you can invoke it can by using the CIM cmdlet Invoke-CIMMethod, as shown here: PS C:\> $ConsistencyCheck = (Invoke-CimMethod -ClassName "MSFT_DSCLocalConfigurationManager" ` -Namespace "root\Microsoft\Windows\DesiredStateConfiguration" ` -MethodName getConfigurationResultOutput) for($i=0; $i -le 100; $i++) { $ConsistencyCheck[$i].ItemValue.Message } [DEMOSERVERWIN10]: [] Starting consistency engine. [DEMOSERVERWIN10]: LCM: [ Start Resource ] [[WindowsFeature]XPS] [DEMOSERVERWIN10]: LCM: [ Start Test ] [[WindowsFeature]XPS] [DEMOSERVERWIN10]: [[WindowsFeature]XPS] Begin running Test functionality on the XPS-Viewer feature. [DEMOSERVERWIN10]: [[WindowsFeature]XPS] Querying for feature XPS-Viewer using Server Manager cmdlet Get-WindowsFeature. [DEMOSERVERWIN10]: [[WindowsFeature]XPS] The operation 'Get-WindowsFeature' started: XPS-Viewer [DEMOSERVERWIN10]: [[WindowsFeature]XPS] GetServerComponentsAsync provider method started: XPS-Viewer [DEMOSERVERWIN10]: [[WindowsFeature]XPS] Call to GetServerComponentsAsync provider method succeeded. [DEMOSERVERWIN10]: [[WindowsFeature]XPS] The operation 'Get-WindowsFeature' succeeded: XPS-Viewer [DEMOSERVERWIN10]: [[WindowsFeature]XPS] End running Test functionality on the XPS-Viewer feature. [DEMOSERVERWIN10]: LCM: [ End Test ] [[WindowsFeature]XPS] in 0.4667 seconds. [DEMOSERVERWIN10]: LCM: [ End Resource ] [[WindowsFeature]XPS] [DEMOSERVERWIN10]: [] Consistency check completed.

Articles in this issue

Archives of this issue

view archives of Netherlands: Software - Introductie Windows Server 2016