Azure Billing – PowerShell

Billing in Azure can be a beast to get your head around. But the new billing API that was announced last year by Scott Guthrie makes it easy to export the billing information to a .CSV file, where you can massage it in Excel and make it look pretty. There’s two parts to it, the Azure Usage API and the Azure RateCard API, we will focus on the forma. The PowerShell script below pieced together runs through exporting Azure usage from the Billing API. The problem is the fact that there’s a limit to the number of lines of data…

Azure Inventory – PowerShell

Ever wanted to get a list of all Azure Resources, Virtual Machines or Web Apps (Web Sites) that you have in Azure across both ASM (Classic) and ARM (Azure Resource Manager)? Now you can get a report fully automatically using a PowerShell script I whipped up. The script exports all information to .CSV files. The other good thing is that this script will gradually work its way through all Azure subscriptions that the account has access to. First thing you need to do is logon to Azure (at the top of the script), this part can be automatic if you are…

Use PowerShell to install Windows Updates

PowerShell for Windows updates? Why would you want to do this other than the fact that it’s a cool thing to do? Well it’s fairly easy to do and can be easilly automated. Firstly you will need version 5 of PowerShell which is apart of Windows 10. Since version 5 you can now download and install modules online from the PowerShell Gallery. First thing you need to do is confirm the version of PowerShell you have: If version 5 or above, confirm you are running PowerShell as administrator and continue with: Then you will need to register to use the…

Azure Resource Manager – Multiple VMs behind a load balancer

This post is part 4 of a small series and stems from this post https://marckean.com/2016/05/17/azure-resource-groups-networks/ This post focuses on creating a two virtual machines into the Internal subnet of the target example architecture diagram below. These VMs will utilise inbound NAT rules from the load balancer. Remember, that the subnet based NSG rule/s will also be applied as the NICs of both machines will live on the Internal subnet which has an NSG attached to it. The PowerShell below, just simply edit / check the variables to suit before running it. This file contains hidden or bidirectional Unicode text that may be interpreted…

Azure Resource Manager – Single VM with an NSG

This post is part 3 of a small series and stems from this post https://marckean.com/2016/05/17/azure-resource-groups-networks/ This post focuses on creating a single virtual machine into the DMZ subnet of the target example architecture diagram below. This VM will have an NSG attached to its NIC. Remember, that the subnet based NSG rule/s will be applied first, so if there’s a match then the NIC based NSG will effectively be ignored. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden…

Azure Resource Groups – NSGs

This post is part 2 of a small series and stems from this post https://marckean.com/2016/05/17/azure-resource-groups-networks/ This post discussed Azure Resource Groups and splitting all IaaS Azure resources across multiple Azure Resource Groups for an easy way to delete targeted resources and easy of delegating admin. This post focuses on NSGs (Network Security Groups). A quick re-cap, with ARM based NSGs… …you can apply a NSG to both a subnet or a NIC The order of the NSG rules that are applied are NSG rules attached to a virtual network subnet and then a NIC. Once there’s a match, it takes that Each…

Remote PowerShell / WinRM

There’s a lot of articles online how to setup remote PowerShell or how to configure remote PowerShell. I have found that all articles on how to setup remote PowerShell are not all complete. As in there’s some information there, different parts of information all over the place across different posts and not in the complete order and/or missing steps. You need Remote PowerShell to administer Windows servers and these days with PowerShell, you can do everything and anything with PowerShell, so remote PowerShell is a must. Remote PowerShell is a little hard to setup and comes in two flavours, HTTP…