AZ-400 – Question 163

0
0
HOTSPOT –

You plan to use Desired State Configuration (DSC) to maintain the configuration state of virtual machines that run Windows Server.
You need to perform the following:
✑ Install Internet Information Services (IIS) on the virtual machines.
✑ Update the default home page of the IIS web server.
How should you configure the DSC configuration file? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Correct Answer:

Box 1: WindowsFeature –
Example:
Configuration WebsiteTest {
# Import the module that contains the resources we’re using.
Import-DscResource -ModuleName PsDesiredStateConfiguration
# The Node statement specifies which targets this configuration will be applied to.
Node ‘localhost’ {
# The first resource block ensures that the Web-Server (IIS) feature is enabled.
WindowsFeature WebServer {
Ensure = "Present"
Name = "Web-Server"
}
Box 2: File –
Example continued:
# The second resource block ensures that the website content copied to the website root folder.
File WebsiteContent {
Ensure = ‘Present’
SourcePath = ‘c:\test\index.htm’
DestinationPath = ‘c:\inetpub\wwwroot’
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here