Author: ksanks

Just another User's blog Site

Azure VM deletion using the PowerShell script

Often you might receive a request to Delete multiple VMs from Azure. its little cumbersome to delete VM and its components from portal. Automation minimize the time and avoid human errors. This could cover the below scenarios: Delete VM, its associated NICs and disks. The following guide assumes that the user has basic knowledge of…
Read more

Azure ARM Blob Snapshot – Azure Automation

We have had some tough time backing up virtual machines based out of customized VHD and running OS prior to Windows Server 2008 R2 SP1, The reason being, Azure Virtual Machine Guest agent does is not supported in any of these OS, i.e. Windows Server 2003 R2, Windows XP, etc. (You might wonder is it…
Read more

Assign Tags for virtual machines provided in an input file

Automation | VM Tags Creation Overview Tagcreation.ps1 is a PowerShell script to create tags for all VMs provided in the input csv, Azure tag is an important feature that helps you to identify the deviation and make them standard. Also you can make use of tags in the Azure automation runbook to customise many automation…
Read more

Attach Data disks for all VMs provided in the input file

Automation | VM Disk Attachment Overview Disk_attach.ps1 is a PowerShell script to attach data disks for all VMs provided in the input csv. The following guide assumes that the user has basic knowledge of using Windows and PowerShell. Although some familiarity with the Azure Portal would be beneficial, it is absolutely not necessary, as a…
Read more

PowerShell script to expand an Azure VM OS disk size

This script helps to expand an Azure VM OS disk size.   We normally can do this from the Azure Portal after we shut down the VM.  However, some of the VMs running custom VHD based out of Windows Server 2003,  we are not able to find the option to specify os disk size even…
Read more

Create a VM from existing VHD file

A tricky task with creating an Azure ARM Virtual machine specially from an existing VHD.   We had immense trouble getting this right for a project, until we managed to find the right script to be used for the purpose. There are 2 scenarios in which you will create a Virtual Machine from a VHD…
Read more

PowerShell to create and assign Tags to Azure ARM Virtual Machines

A script we have developed for creation of the tags for azure VM.   We use an input file to update the tags and as a test, I had done it with upto 7 tags, however, you can have a maximum of 15 tags assigned to the resources in Azure. This script however, is used to…
Read more

Powershell script to deploy virtual machine with multiple vNIC in Azure ARM

We had a requirement from one of the teams to deploy a virtual machine with multiple NIC associated with a single Virtual Machine.  The Azure portal does not provide any option to either associate a NIC ( Network Interface Card) to a Virtual Machine nor does it allow us to associate or create a Virtual…
Read more

Network Security Groups (NSGs) and Rules Implementation Guide

We were asked to come up with a guide on how to create NSG rule as part of the implementation for a client.   This will include a script used to set these instead of creating them via the Azure Portal. One of the many documents we had to come up but was useful. [embeddoc…
Read more

Script to Delete Azure ARM Virtual Machine

We had a request to create a script which will take care of deleting a Virtual Machine from Azure subscription and perform the clean up of all the associated objects as a deleting the virtual machine from the azure portal will remove the VM object alone and does not delete the disks, vNICs, etc. We…
Read more