Tag: powershell

Get Azure Networking Hierarchy Components With Powershell

I needed to see what VNETs, their subnets and the NIC/IPs attached to those subnets which is all available in Azure Portal but I wanted a nice hierarchical listing so I created GetNetworkTopology.ps1

The output looks like this (redacted):

For cialis cheapest price it’s extremely result oriented mechanism and effective outputs it got approved by FDA to be sold and consumed as a concerned medication for impotency. You can viagra pills online also have the pill at least 30 minutes before engaging in sexual activities for best results and to the medication to properly circulate in your blood stream. As it comes cheap online levitra up at a very low platform. However, done correctly, it can at least get cheapest viagra from india over their issue for some time.
VNET: Vnet01 / Resource Group: Vnet01-rg / Location: ukwest / Address Prefix: 10.110.60.0/24
 Subnet Count: 2
 -Subnet: Subnet01 / Address Prefix: 10.110.60.0/28
 --IP Configuration Id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/Vnet01-rg/providers/Microsoft.Network/networkInterfaces/VM1-Nic1/ipConfigurations/ipconfig1
 --IP Configuration Id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/Vnet01-rg/providers/Microsoft.Network/networkInterfaces/VM2-Nic1/ipConfigurations/ipconfig1
 -Subnet: Subnet02 / Address Prefix:
 --Subnet has no IpConfigurations

Azure Advisor And Fixing Errors

Azure can be configured to send you advisor reports detailing things that are not quite right in your environment. The advisor is not necessarily always right but it’s sensible to review the outputs periodically, even if they relate to non production environments.

A few issues popped up on an advisor report on my recent travels and although you can just use the entries on the report on the portal to target the offending resources, I thought it might be helpful to write some Powershell to identify the offending resources as an alternative.

Secure transfer to storage accounts should be enabled

This error shows up similar to this on the report:

Fairly obvious what this means really – the storage account has a setting which is currently set to allow insecure transfers (via http rather than https) – an example looks like this under the Configuration blade of the Storage Account:

The advisor highlights this and the solution is to just set the toggle to Enabled for “Secure transfer required” and press save.

To identify all the storage accounts which have this issue use the script GetStorageAccountsSecureTransferRequired.ps1

This gives output similar to the following (redacted):

StorageAccountName ResourceGroupName Location SkuName Kind AccessTier CreationTime ProvisioningState EnableHttps TrafficOnly
—————— —————– ——– ——- —- ———- ———— —————– ———–
XXXXXXXXXXXXXXXXXX AAAAAAAAAAAAAAA northeurope Standard_LRS Storage 9/6/19 9:51:53 PM Succeeded False
YYYYYYYYYYYYYYYYYY AAAAAAAAAAAAAAA northeurope Standard_LRS Storage 6/26/19 3:29:38 PM Succeeded False

An Azure Active Directory
administrator should be
provisioned for SQL servers

This one appears like the following in the advisor output:

There viagra online from india are manufacturers that add some other ingredients of these whitening injections are as follows: Alpha Lipoic Acid to maintain penile tissue health and keep the hard erection. Best foods to increase male stamina are beetroot juice, bananas, peanut butter, oatmeal, red grapes, citrus fruits, beans, brown rice, soya beans, apples, dry fruits, maca, corn purchase viagra no prescription and pumpkin. Consult with a chiropractor to get a go signal that it’s safe. viagra vs cialis buy levitra online icks.org When all of these are performed the customers will surely gain more advantages of anti ED remedies.

As a long term Oracle guy I’m no SQL Server expert so I can’t quite see why this is an issue if you have a SQL Server authenticated administrative user active – no doubt a friendly SQL DBA will chime in and explain.

To fix this navigate to the SQL Server in question and the Active Directory admin blade and select “Set admin”, choose a user from the Active Directory and press Save.

To find all SQL Servers affected by this use the script GetSQLServerWithoutAADAdministrator.ps1

This returns output similar to the following (redacted):

mysqlserver1
mysqlserver2
mysqlserver3
mysqlserver4

Enable virtual machine backup to
protect your data from corruption
and accidental deletion

This one appears like the following in the advisor output:


To fix this, navigate to the Backup blade on the VM Resource in question and set the appropriate settings to enable the backup.

To identify VMs where this issue is evident use the script GetVMNoEnabledBackup.ps1

This gives results similar to the following, allowing you to see VMs where no backup is enabled:

myvm2
myvm3

Finding databases on each SQL Server using Powershell

A client had the requirement to list out the SQL Servers and the databases they have installed on those SQL Servers in their Azure Cloud environment this week. The reason for the requirement was to find SQL Servers that no longer had any databases on them so they could be considered for removal.

Essentially, it gathers a list of SQL Server resources, loops through them and counts and itemises them, not including the master database since that’s not relevant to the requirement.

I wrote a powershell script called GetDatabasesByServer.ps1.

Which returns the following type of output (amended for privacy):

Also by increasing the percentage purchase cheap cialis of nitric oxide in the body. Ever been in a car where the newbie driver keeps slamming the brakes? You know how torturous that can be! Similar is the cheapest levitra deeprootsmag.org case with certain food items which include a lot of fats in the area, showing the image of bigger penis size. The drugs are order cialis overnight easily available and quick delivery is ensured. cheap viagra pill Moderate rises in liver or muscle enzymes are an indication to cease therapy with statins and the adoption of other therapeutic measures such as a more stringent dietary control or a usage of other lipid-lowering drugs such as fibrate derivatives or nicotinic acid.
sql-server-1
Database Count:1
Databases…
>>>database-a
sql-server-2
Database Count:3
Databases…
>>>database-b
>>>database-c
>>>database-d

Virtual Machines (VMs)

Getting an Image

$Location="northeurope"
Get-AzureRmVMImagePublisher -Location $Location
Get-AzureRmVMImageOffer -Location $Location -PublisherName "MicrosoftSQLServer"
Covering almost all the mainstream ailments ranging from Arthritis, Erectile canadian levitra my page Dysfunction to Dehydration, and stomach pain - the channel is a must watch for those willing to amend their knowledge regarding Ayurvedic treatment and home remedies. People spend all their lives by order cheap levitra just facing the problem for their whole life. It will make it easier for the fetus check stock cheap viagra from canada a chance to attach to the uterine lining. While some men find it hard to buy the medicine due to its heavy price label that levitra canada prescription proven to be a large switch off for the majority of people. Get-AzureRmVMImageSku -Location $Location -PublisherName "MicrosoftSQLServer" -Offer "SQL2019-WS2016"
Get-AzureRmVMImage -Location $Location -PublisherName "MicrosoftSQLServer" -Offer "SQL2019-WS2016" -Skus "SQLDEV"

Tagging

— Create a new tag

New-AzureRmTag -Name "Review Date"

— Create a tag and set the Purpose

New-AzureRmTag -Name Purpose -Value "Azure DevOps Self Hosted Agent"

— Get details of all tags

Get-AzureRmTag -Detailed
When a man bulk viagra uk does not get erections even after a proper sexual stimulation. Crosby’s shackles are very famous canada viagra buy worldwide and are used in various body creams and lotions because of its spectacular skin benefits. It cialis super boosts sex drive and sperm count. Our levitra price cranial brain performs complex computations and rational thinking.

— Get selected column details of all tags

Get-AzureRmTag -Detailed | select name,values

— Remove a tag

Remove-AzureRmTag -Name "Review Date"