About Me

My photo
I am an MCSE in Data Management and Analytics, specializing in MS SQL Server, and an MCP in Azure. With over 19+ years of experience in the IT industry, I bring expertise in data management, Azure Cloud, Data Center Migration, Infrastructure Architecture planning, as well as Virtualization and automation. I have a deep passion for driving innovation through infrastructure automation, particularly using Terraform for efficient provisioning. If you're looking for guidance on automating your infrastructure or have questions about Azure, SQL Server, or cloud migration, feel free to reach out. I often write to capture my own experiences and insights for future reference, but I hope that sharing these experiences through my blog will help others on their journey as well. Thank you for reading!

PowerShell script samples that create and manage Windows virtual machines (VMs).


The following table provides links to PowerShell script samples that create and manage Windows virtual machines (VMs).





Create virtual machines
Creates a resource group, a virtual machine, and all related resources, with a minimum of prompts.
Creates a resource group, a virtual machine, and all related resources.
Creates several virtual machines in a highly-available and load-balanced configuration.
Creates a virtual machine and uses the Azure Custom Script extension to install IIS.
Creates a virtual machine and uses the Azure Desired State Configuration (DSC) extension to install IIS.
Uploads a local VHD file to Azure, creates an image from the VHD, and then creates a VM from that image.
Creates a virtual machine by attaching an existing Managed Disk as OS disk.
Creates a virtual machine from a snapshot by first creating a managed disk from the snapshot and then attaching the new managed disk as OS disk.
Manage storage
Creates a managed disk from a specialized VHD as an OS disk, or from a data VHD as a data disk, in the same or a different subscription.
Creates a managed disk from a snapshot.
Copies a managed disk to the same or a different subscription that is in the same region as the parent managed disk.
Exports a managed snapshot as a VHD to a storage account in a different region.
Exports the underlying VHD of a managed disk to a storage account in a different region.
Creates a snapshot from a VHD and then uses that snapshot to create multiple identical managed disks quickly.
Copies snapshot to the same or a different subscription that is in the same region as the parent snapshot.
Secure virtual machines
Creates an Azure key vault, an encryption key, and a service principal, and then encrypts a VM.
Monitor virtual machines
Creates a virtual machine, installs the Azure Log Analytics agent, and enrolls the VM in a Log Analytics workspace.

No comments: