Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam AZ-104 All Questions

View all questions & answers for the AZ-104 exam

Exam AZ-104 topic 1 question 21 discussion

Actual exam question from Microsoft's AZ-104
Question #: 21
Topic #: 1
[All AZ-104 Questions]

Your company has an Azure Active Directory (Azure AD) tenant that is configured for hybrid coexistence with the on-premises Active Directory domain.
The on-premise virtual environment consists of virtual machines (VMs) running on Windows Server 2012 R2 Hyper-V host servers.
You have created some PowerShell scripts to automate the configuration of newly created VMs. You plan to create several new VMs.
You need a solution that ensures the scripts are run on the new VMs.
Which of the following is the best solution?

  • A. Configure a SetupComplete.cmd batch file in the %windir%\setup\scripts directory.
  • B. Configure a Group Policy Object (GPO) to run the scripts as logon scripts.
  • C. Configure a Group Policy Object (GPO) to run the scripts as startup scripts.
  • D. Place the scripts in a new virtual hard disk (VHD).
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
j5y
Highly Voted 2 months, 1 week ago
Ans: A After Windows is installed but before the logon screen appears, Windows Setup searches for the SetupComplete.cmd file in the %WINDIR%\Setup\Scripts\ directory
upvoted 79 times
jackdryan
1 year, 9 months ago
A is correct.
upvoted 3 times
...
...
NaoVaz
Highly Voted 2 years, 2 months ago
Selected Answer: A
GPOs aren't a thing in Azure AD. Just putting a Script inside the VHD doesn't make it run on boot. Configuring a "SetupComplete.cmd" in the "%windir%\setup\scripts" directory is the correct approach:
upvoted 17 times
...
shacky100
Most Recent 4 days, 11 hours ago
ans: C https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn789196(v=ws.11)
upvoted 1 times
...
moniker
1 week, 6 days ago
Selected Answer: C
the best solution is to configure a Group Policy Object (GPO) to run the scripts as startup scripts (Option C). This ensures that the PowerShell scripts are executed when the VMs start up, which is ideal for automating the configuration of newly created VMs in a consistent manner
upvoted 1 times
...
leonmc00
2 weeks ago
Selected Answer: C
As the question specifies "The on-premise virtual environment consists of virtual machines (VMs) running on Windows Server 2012 R2 Hyper-V host servers." the correct answer is C. IF the VMs were running in Azure then the answer would be A
upvoted 1 times
...
shafiqeee
3 weeks, 1 day ago
Selected Answer: C
should be the C
upvoted 1 times
...
Andre369
1 month, 3 weeks ago
Selected Answer: C
C. Configure a Group Policy Object (GPO) to run the scripts as startup scripts. By configuring a Group Policy Object (GPO) to run the scripts as startup scripts, you can automate the execution of the PowerShell scripts on the new VMs when they start up. This ensures that the scripts are executed consistently and reliably on each VM during the startup process. Option A, configuring a SetupComplete.cmd batch file in the %windir%\setup\scripts directory, is not the best solution in this scenario as it applies only to the initial installation of Windows and would not cover the configuration of newly created VMs. Option B, configuring the scripts as logon scripts through Group Policy, may not be ideal in this case as logon scripts are executed when a user logs in, whereas the requirement is to run the scripts on the VMs themselves, regardless of user logins. Option D, placing the scripts in a new virtual hard disk (VHD), would require additional configuration steps and might not be necessary or the most efficient solution for executing PowerShell scripts on the new VMs.
upvoted 8 times
etrop
8 months, 3 weeks ago
Will group policy even work if the systems are not joined to the domain yet?
upvoted 2 times
...
SivaPannier
1 year, 2 months ago
The custom system configuration is a one time activity for every VM. If we keep that in the startup script, the configuration will be executed every time the VM is started and it is not expected. Hence the answer should be A. Also the SetupComplete.cmd will be acting as a wrapper and it can be wired to powershell script.
upvoted 5 times
...
...
asuarez
1 month, 3 weeks ago
Selected Answer: C
The best solution to ensure that your PowerShell scripts are run on the new VMs is to configure a Group Policy Object (GPO) to run the scripts as startup scripts (Option C). This approach ensures that the scripts are executed when the VM starts up, which is ideal for initial configuration tasks.
upvoted 1 times
sca88
3 weeks, 5 days ago
In this way the script will be executed on each restart of the VM... The correct answer shold be A
upvoted 1 times
...
...
dirkxi
1 month, 4 weeks ago
The correct answer is C. This is not an Azure-specific question but a general Microsoft enterprise-managed question.
upvoted 1 times
...
Pcservices
2 months ago
Selected Answer: C
Startup scripts in Group Policy apply before any user logs in, during the system boot process. This makes it a better solution for automating configurations that need to happen at the system level for every new VM. It ensures the scripts are applied when the machine starts.
upvoted 1 times
...
Iron_Man_111
2 months, 1 week ago
Selected Answer: A
Run a script after setup is complete (SetupComplete.cmd) Order of operations 1. After Windows is installed but before the logon screen appears, Windows Setup searches for the SetupComplete.cmd file in the %WINDIR%\Setup\Scripts\ directory. 2. If a SetupComplete.cmd file is found, Windows Setup runs the script. Windows Setup logs the action in the C:\Windows\Panther\UnattendGC\Setupact.log file. 3. Setup does not verify any exit codes or error levels in the script after it executes SetupComplete.cmd. 4. If the computer joins a domain during installation, the Group Policy that is defined in the domain is not applied to the computer until Setupcomplete.cmd is finished. This is to make sure that the Group Policy configuration activity does not interfere with the script.
upvoted 6 times
...
In this case ... It means that you are going to deploy several VMs ... Option A is valid but... If you deploy 100VMs is not logical to go 1 by 1 creating that .bat. Option C is valir and is the best cuz with a GPO you can implement it at the same time ... SEVERAL VMs is the critical point here.
upvoted 1 times
...
TheFivePips
3 months, 3 weeks ago
Selected Answer: C
A could work, but has nothing to do with azure, so C is the best option
upvoted 1 times
Highgate
3 months, 3 weeks ago
Neither have anything to do with Azure, but for the GPO to fire, the server would need to be joined to the domain first. While it doesn't explicitly state either way, A always fires. "After Windows is installed but before the logon screen appears, Windows Setup searches for the SetupComplete.cmd file in the %WINDIR%\Setup\Scripts\ directory. If a SetupComplete.cmd file is found, Windows Setup runs the script. This script runs with local system permissions ."
upvoted 2 times
...
...
Mixxy1010
4 months ago
I would vote C, assuming you are running a domain with Group policy enabled. as the question doesnt specifically state that Group policy is in use, you have to assume local scripts are run to configure the machine. hence A is the answer, even if its a really dumb way to manage your machines.
upvoted 3 times
...
chucklu
4 months, 1 week ago
The second link provided in Answer does not work.
upvoted 1 times
...
76d5e04
6 months ago
Many windows server administration related questions are poping up, seems unrelevant
upvoted 2 times
...
Didatzi
6 months, 1 week ago
Selected Answer: C
Answer A is valid. Answer C is also valid, if you have the VM's joined to the AD domain. It is better to manage VM's with GPO instead of running scripts manually on each VM. Using GPO will minimize the effort and will save time. I personally prefer answer C. Here, the questions does not provide enough information to choose the correct answer between the two.
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...