Wriju's BLOG

.NET, Cloud and everything

Bulk VM creation from CSV using Azure PowerShell

This sample talks about few basic aspects of Azure PowerShell, 1. Reading from CSV 2. Parameterizing PowerShell 3. Calling another PowerShell from PowerShell with Parameters Now let’s see how the CSV lools like, And I am going to use these three columns as input parameters for another script. So to read this one might use… Read more

Find unused Managed Disks

In your Azure you might have created Managed disks and never used them. Do you still pay for disks which are not in use? Then delete them if they are not in use. https://github.com/wrijughosh/PowerShellWG/blob/master/OrphanDataDisk.ps1 Namoskar!!!… Read more

Quick Tip while working with Azure PowerShell

Azure PowerShell is an ocean of commands. Remembering them while working is next to impossible. Azure PowerShell gives you an elegant option to find out what you need. Few things I use while try to explore what’s there for me while exploring the options. Use Get-Help Get-Help is a powerful command. You can use it… Read more

Azure PowerShell Login “Remember Me”

We use “Remember Me” feature quite a lot in our personal computers for quick login. This seamless experience can be achieved in Azure PowerShell as well. When you work with Azure PowerShell it asks for the login. Once you close the PowerShell windows it automatically clears up the context. You may want to keep it… Read more

Azure PowerShell Get to know about availability of the VM sizes

You may know that all Azure regions does not provide all types and sizes of VMs. So while designing a deployment it is important to understand what is in the store, A simple PowerShell would give you list of VM Sizes Get-AzureRmVMSize -location eastus You may also dump this to a .csv file Get-AzureRmVMSize -location… Read more

Getting Azure VM Remote Desktop File in PowerShell

I often just need the Remote Desktop file of a VM  to work. For that it takes a longer time to go to the portal and download. Rather I prefer the PowerShell way of doing it. $vm = "WGTFS2015" $service = "WGTFS2015" $file = "C:\Azure\WGTFS2015.rdp" Get-AzureRemoteDesktopFile -Name $vm -ServiceName $service -LocalPath $file Invoke-Item $file Namoskar!!!… Read more

PowerShell why should you learn and how must start

If you really care about performing Automation in your System dominated by Microsoft products its high time that you start thinking seriously about PowerShell. Now since you are forced to use PowerShell a many of you might already have started but getting difficulties of interpreting the way it is written. Or you are writing in… Read more

Azure PowerShell Know the differences

There are a bunch of confusing PowerShell commands which looks the same by their name. Add-AzureDataDisk : Adds a data disk to a virtual machine. The Add-AzureDataDisk cmdlet adds a new or existing data disk to an Azure virtual machine object. Use the CreateNew  parameter to create a new data disk that has a specified… Read more

Azure PowerShell Getting the Remote Desktop File

When you are on Go and Portal is not responding well, you might be in need to get the remote desktop file of a Virtual machine Step 1: Login to Azure > Add-AzureAccount Point to the right subscription > Select-AzureSubscription -SubscriptionName "Your Subscription Name" Step 2: Then get the list of Virtual machines > Get-AzureVM… Read more

Manage your own Azure Subscription using PowerShell

You might be using a Dev/Test Azure account and to save the money you would like to Shutdown all the VMs. Since VMs are creating ad-hoc you don’t know the exact name. But you need to shut them down all. Let’s see 1.       Open Azure PowerShell 2.       Run Get-AzurePublishSettingsFile. This will ask login, log in… Read more

Azure PowerShell : Forbidden Error: The server failed to authenticate the request

You have used Add-AzureAccount command to connect to Azure Account or might have used .publishsettings file. But even after you have successfully connected you get this error every time you want to run any Azure command Forbidden Error: The server failed to authenticate the request Your frustration mounts. Many try, many searches in various forums…. Read more