AZ-400 · Question #407
Hotspot Question You plan to use Desired State Configuration (DSC) to maintain the configuration of a server that runs Windows Server 2019. The server must have the following features installed: A web
The correct answer is Name: =@("Mail-Server", "Web-Server"); Property for 'Present': Ensure. This question tests knowledge of PowerShell Desired State Configuration (DSC) syntax for installing Windows Server features using the WindowsFeature resource. You must complete a DSC configuration block that installs both a web server (IIS) and an email server (SMTP) feature.
Question
Exhibit
Answer Area
- Name=@("Mail-Server", "Web-Server")=@("Mail-Server", "IIS")=@("SMTP-Server", "IIS")=@("Mail-Server", "Web-Server")=@("SMTP-Server", "Web-Server")
- Property for 'Present'EnsureInstallEnsureEnforceRequired
Explanation
This question tests knowledge of PowerShell Desired State Configuration (DSC) syntax for installing Windows Server features using the WindowsFeature resource. You must complete a DSC configuration block that installs both a web server (IIS) and an email server (SMTP) feature.
Approach. The correct DSC configuration uses the 'WindowsFeature' resource type to declare features that must be present. For a web server, the feature name is 'Web-Server' (IIS), and for an email server, the feature name is 'SMTP-Server'. Each WindowsFeature block requires a unique resource name/label, the 'Name' property set to the Windows feature name, and 'Ensure' set to 'Present' to guarantee the feature is installed. The DSC keyword 'Node' defines the target machine, and each resource block follows the pattern: WindowsFeature <UniqueLabel> { Name = '<FeatureName>'; Ensure = 'Present' }.
Concept tested. PowerShell DSC (Desired State Configuration) configuration file syntax, specifically the use of the WindowsFeature DSC resource with correct feature names ('Web-Server' for IIS and 'SMTP-Server' for email), the 'Ensure = Present' property, and proper DSC configuration block structure including Configuration, Node, and WindowsFeature keywords.
Topics
Community Discussion
No community discussion yet for this question.
