View DSC Applied to a Machine
Learn how to check the DSC applied to a machine.
March 11, 2015
Q. How can I view the PowerShell DSC file applied to a server?
A. You cannot view the original DSC file used to configure a server. A PowerShell DSC file is converted to a MOF file specific to a host when the PowerShell DSC configuration is executed, and that MOF content is then applied to a server that consists of the various configurations. These configurations can be viewed using the Get-DscConfiguration cmdlet. An example is show below which shows the various configuration applied.
PS S:ToolsDSC> Get-DscConfigurationCredential : DisplayName : Web Server (IIS)Ensure : PresentIncludeAllSubFeature : FalseLogPath : Name : Web-ServerSource : PSComputerName : Credential : DisplayName : ASP.NET 4.5Ensure : PresentIncludeAllSubFeature : FalseLogPath : Name : Web-Asp-Net45Source : PSComputerName : ApplicationPool : DefaultAppPoolBindingInfo : {MSFT_xWebBindingInformation}Ensure : PresentId : 1Name : Default Web SitePhysicalPath : C:inetpubwwwrootState : StoppedPSComputerName : Attributes : {directory}Checksum : Contents : CreatedDate : 2/15/2015 8:28:04 AMCredential : DestinationPath : C:inetpubSavillSiteEnsure : presentForce : MatchSource : ModifiedDate : 2/15/2015 8:28:04 AMRecurse : Size : 0SourcePath : SubItems : {MSFT_FileDirectoryConfiguration (DestinationPath = "C:inetpubSavillSiteheader_main.jpg"), MSFT_FileDirectoryConfiguration (DestinationPath = "C:inetpubSavillSiteindex.html")}Type : directoryPSComputerName : ApplicationPool : DefaultAppPoolBindingInfo : {MSFT_xWebBindingInformation}Ensure : PresentId : 2Name : SavillSitePhysicalPath : C:inetpubSavillSiteState : StartedPSComputerName :
In this example you can see that the IIS Web server and ASP.Net 4.5 are installed, the default website stopped, an alternate set of files present, and then a new website created using those files. This relates directly to the content in the original DSC and created MOF file.
About the Author
You May Also Like