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 weeks, 2 days 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 75 times
jackdryan
1 year, 7 months ago
A is correct.
upvoted 3 times
...
...
NaoVaz
Highly Voted 2 years 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 16 times
...
Andre369
Most Recent 4 days, 1 hour 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 6 times
etrop
7 months ago
Will group policy even work if the systems are not joined to the domain yet?
upvoted 1 times
...
SivaPannier
1 year, 1 month 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 2 times
...
...
asuarez
5 days, 23 hours 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
...
dirkxi
1 week, 1 day ago
The correct answer is C. This is not an Azure-specific question but a general Microsoft enterprise-managed question.
upvoted 1 times
...
Pcservices
1 week, 4 days 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 weeks, 2 days 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
...
juanmacoellocloudsecarch
1 month, 1 week ago
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
2 months ago
Selected Answer: C
A could work, but has nothing to do with azure, so C is the best option
upvoted 1 times
Highgate
2 months 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
2 months, 1 week 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
2 months, 3 weeks ago
The second link provided in Answer does not work.
upvoted 1 times
...
76d5e04
4 months, 1 week ago
Many windows server administration related questions are poping up, seems unrelevant
upvoted 2 times
...
Didatzi
4 months, 2 weeks 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
...
3c5adce
4 months, 3 weeks ago
Between A & C - ChatGPT4 says C. The option A, using a SetupComplete.cmd batch file, is primarily intended for tasks that need to be executed once after the operating system is installed or configured. While it can technically run scripts post-setup, it's less flexible and manageable compared to using Group Policy. Option C, configuring a Group Policy Object (GPO) to run scripts as startup scripts, provides better manageability and scalability. With GPOs, you can easily update, manage, and apply scripts across multiple VMs in the domain automatically every time the machines start up, not just after initial setup. This makes it more suitable for ongoing operations and management in a hybrid environment like yours.
upvoted 3 times
...
MelKr
6 months, 2 weeks ago
Selected Answer: C
Group policies can be replicated to Azure AD. The question does not state where the new VMs will be created (On Prem or in Azure). So Group Policies is the only option that works for both.
upvoted 2 times
...
Amir1909
7 months, 1 week ago
A is correct
upvoted 1 times
...
nospampls
7 months, 1 week ago
Selected Answer: C
c
upvoted 1 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 ...