Recover database encrypted modules code with dbatools

This article was initially posted on SQLServerCentral @ 2020-08-18. It was interesting some comments I read about it, mainly why people still use WITH ENCRYPTION when it's simple to overcome this when we have the right permissions. SQL Server offers an option to encrypt the code of your modules when using the WITH ENCRYPTION syntax. … Continue reading Recover database encrypted modules code with dbatools

Generate SQL Server Role Member Reports using dbatools and ImportExcel PowerShell modules

This was initial posted on SQL Server Central articles. As one of dbatools' first members, I've been using it for years and it's really my goto tool. This task was no different! Today's tip and trick using dbatools is about generating an Excel workbook that contains lists of SQL Server roles and its members. The … Continue reading Generate SQL Server Role Member Reports using dbatools and ImportExcel PowerShell modules

Backup your SQL instances configurations to GIT with dbatools – Part 2 – Add parallelism

We have seen how we can export and save the results to a folder and commit them to a GIT repository on my last blog post Backup your SQL instances configurations to GIT with dbatools – Part 1. At the end of that post, I have mentioned that I would write about how we can … Continue reading Backup your SQL instances configurations to GIT with dbatools – Part 2 – Add parallelism

Backup your SQL instances configurations to GIT with dbatools – Part 1

Today I want to share how I'm keeping a copy of instances' configurations using dbatools. Chrissy LeMaire (B | T) wrote about it before on the Simplifying disaster recovery with dbatools blog post. In this post, I will add one step and save the output on a GIT repository. Pre-requirements You need a GIT repository … Continue reading Backup your SQL instances configurations to GIT with dbatools – Part 1

Replicate permissions to new Login/User with dbatools

Continuing to share tips and tricks using dbatools like the Refresh databases that belongs to availability group using dbatools posted a few days ago, today I will share a way to export the permissions of a login/user at instance/database level and apply them to a new login/user. The typical request Client: "We have a new … Continue reading Replicate permissions to new Login/User with dbatools

Export Deadlocks to file from system_health Extended Event using PowerShell

Just a quick post as may help any of you searching for this. Scenario Client wants to analyze most recent deadlocks that happened on a specific instance. They asked us to send the xdl files. How do we get the deadlocks? Depending on the version of SQL Server that you are running, there are different … Continue reading Export Deadlocks to file from system_health Extended Event using PowerShell

Refresh databases that belongs to Availability Group using dbatools

Few days ago I was surfing on Twitter when dbatools asked about how it's PowerShell module changed the way people work. https://twitter.com/psdbatools/status/1261563168113012736 Open and check the answers given by the community as there is really good stuff there! My turn I have shared one of my recipes related to database refreshes. You know, when the … Continue reading Refresh databases that belongs to Availability Group using dbatools

T-SQL Copy & Paste Pattern – Increasing a performance problem

Disclaimer: The title is my assumption because I saw it in the past happening this way. This blog post aims to make you remember something: something that is obvious to you, might not be obvious to others. Scenario: A client has a process which consists of a stored procedure that wraps a bunch of other … Continue reading T-SQL Copy & Paste Pattern – Increasing a performance problem

Change Outlook sender mailbox with PowerShell – A workaround

The idea of this blog post, like many others I write, is to document a workaround solution to my problem. Hopefully I can also help someone that may be looking for the solution for this problem and stumbles accidentally (or not) on my blog. Scenario I was helping a colleague automating the creation of emails … Continue reading Change Outlook sender mailbox with PowerShell – A workaround

Allow SQL Server Agent jobs management for non sysadmins

I don't know about your experience when it comes to SQL Server Agent jobs but often I receive requests to grant permission so that clients can handle their jobs in an autonomous way. Any problem with that? It depends 😄 If you're not familiarized with the difficulty this can bring, let me share with you … Continue reading Allow SQL Server Agent jobs management for non sysadmins