Your on-premises virtual environment runs Windows Server 2012 R2 VMs on Hyper-V. You have PowerShell scripts to configure new VMs and want those scripts to run automatically on newly created VMs. Which is the best solution?
Choose an answer
Tap an option to check your answer.
Correct answer: Configure a SetupComplete.cmd batch file in the %windir%\setup\scripts directory..
Why this is the answer
SetupComplete.cmd is a special batch file executed by Windows Setup after the operating system is installed and the first user logs on. Placing your PowerShell scripts here ensures they run automatically on newly created VMs, as this is a built-in mechanism designed for post-installation configuration. Configuring a GPO for logon or startup scripts would require the VM to be joined to a domain and the GPO to be applied, which might not be the case immediately after creation or during the initial setup phase. Placing scripts in a new VHD would make them accessible but wouldn't automatically execute them; you'd still need a mechanism to trigger their execution.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed