Skip to content
HOME / AZURE / SYSPREP AND CAPTURE AZURE 2 years AGO

Azure

Sysprep and Capture Azure VM

Sysprep and Capture Azure VM

Last Updated on August 7, 2025 by Arnav Sharma

Welcome to our quick guide on Sysprepping and capturing a Windows VM in Azure. Whether you’re a cloud pro or just starting out, we’ll walk you through the essentials of creating a VM image that has been successfully created from a generalized standard, perfect for scalable deployments. Alright, let’s get started on creating an image!

  1. Prepare the Windows VM:

    • Start the VM in Azure if it’s not already running.
    • Connect to the VM using Remote Desktop Protocol (RDP) and then preview its status.
    • Once connected, ensure all the latest updates are installed and any required software is configured.
  2. Run Sysprep on the VM:

    • Open the Windows Command Prompt on your local machine as an admin.
    • Navigate to the sysprep folder using the command: cd %WINDIR%system32sysprep
    • Run sysprep with the following command: sysprep /oobe /generalize /shutdown
    • This command will generalize your VM, prepare it for OOBE (Out-of-Box Experience), and then shut it down, proving the provision was a success.
  3. Deallocate the VM:

    • Return to the Microsoft Azure portal.
    • Navigate to your VM and click on the “Stop” button to deallocate the VM. Using the ‘e.g’ command, it is important to preview the VM status because you can’t capture a VM that is running or suspended.
  4. Capture the VM Image:

    • In the Azure portal, navigate to your VM.
    • Select the option “Capture” from the top menu.
    • Provide a name for the captured image.
    • You can choose to delete the VM after capture if it’s no longer needed.
    • Select the resource group where you want to store the image.
    • Click the “Create” button to start the capture process.
  5. Using the Captured Image:

    • Once the image is captured, it will be available in the specified resource group.
    • You can use this image to create new VMs.
    • To create a new VM from the captured image, navigate to the image in the Azure portal and select “Create VM”.

Arnav Sharma
Arnav Sharma Microsoft MVPMCT
Microsoft Certified Trainer · Cloud · Cybersecurity · AI

I help organisations secure their cloud infrastructure and stay ahead of evolving cyber threats. Microsoft MVP and Certified Trainer, author of Mastering Azure Security, and founder of arnav.au — a platform for practical Cloud, Cybersecurity, DevOps and AI content.

Frequently Asked Questions

KEEP READING

Leave a reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.