Tag: sqlserver

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