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...


Microsoft AZ-400 Exam

Questions Number: 384 out of 535 Questions
71.78%

Question 384
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:
AZ-400_384Q.png related to the Microsoft AZ-400 Exam



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: est\index.htm'
DestinationPath = 'c:\inetpub\wwwroot'
}
Reference:
https://docs.microsoft.com/en-us/powershell/scripting/dsc/quickstarts/website-quickstart





Previous Questions Next Questions