In this post I want to cover useful SQL Server related PowerShell Modules for the DBA. With this in mind, lets start with the one which is probably the most common module.
SQLServer
First of all, lets clear one thing up. To clarify, the SQLServer PowerShell
module is the replacement for the old PSSQL module.
So, if you happen to see any vendor documentation referring to PSSQL, they probably mean this module. Which means than it’s more then likely that they need to either update their documentation or their scripts. In reality, it could mean they have to update both.
However, sometimes the older module is still required with older scripts. So, you can use the older PSSQL module for backwards compatibility.
In reality, the SQLServer module has newer cmdlets. You can find out more about the SQL Server PowerShell module here.
Azure/AzureRM/AzureRM.Core/Az
OK, lets see if I can explain this without causing mass confusion. In the beginning, there was the Azure PowerShell module. It was introduced to cover the old ASM (Azure Service Manager) fabric that Azure used in the past.
As you might know, the Azure fabric has since changed. It now uses what is called the ARM (Azure resource manager) architecture. Instead of changing the existing Azure module to cater for both Microsoft decided to create a new module with RM on the end.
To cater for the newer cross platform version of PowerShell (PowerShell Core), Microsoft released another module called AzureRM.Core. Which has similar functionality to the AzureRM module. For those of you who are not aware, PowerShell Core is also known as PowerShell 6.
As you can imagine the two separate AzureRM modules has got very confusing for people. Therefore, to resolve this Microsoft released the Az module to replace them. You can find out more about this in detail here.
You can read more about the Az module itself in detail here.
dbatools
I’m sure a lot of you have heard about dbatools by now. Due to it’s increase in popularity. In addition, it has been covered a lot over the years at various conferences.
However, for those of you who have not heard of the extremely popular dbatools module yet, here’s some information about it.
It’s a module that has been developed by various members of the SQL Server community. It was originally aimed at doing SQL Server migrations, but it has grown and now covers a lot more.
For example, recently it has added cmdlets to help with Availability Groups. Which you can read more about in detail here.
A spin off from this module is dbachecks, which I talked about in my previous post in detail here. In addition, there is currently a highly anticipated book being written about it.
UserRights
UserRights a really easy PowerShell module which allows you to allocate rights to service accounts within Windows. In fact, I’ve used this on Windows Server 2016 Core edition and it’s great.
You can use this instead of having to delve into complex code. You can find out more about this module in detail here.
Because it is currently on the TechNet Gallery, I would download it before the TechNet Gallery is retired.
For those who did not know, you can read the announcement about the TechNet Gallery retirement in detail here.
Final word
Well, that’s it from me in this post about useful SQL Server related PowerShell Modules for the DBA.
Of course, these are modules I tend to find useful and are not a complete list of all the modules you can use with SQL Server.
Feel free to comment if you use other PowerShell modules with SQL Server as well.
[…] I did talk in detail about some of the more useful Powershell modules in a previous post here. […]
[…] If you are wondering which modules I could be talking about, I mention some in a previous post which you can read in detail here. […]
[…] Useful SQL Server related PowerShell Modules for the DBA […]
[…] Just to recap, dbatools is a popular PowerShell that can be used for SQL Server. I covered it in a previous post about PowerShell modules here. […]