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

More PowerShell Remoting coverage in dbatools

Starting on dbatools version 1.0.31 we introduced better coverage for commands that make use of PowerShell Remoting. Which commands? Commands like Get-DbaComputerCertificate, Get-DbaPrivilege, Get-DbaClientAlias, just to mention a few of them, make use of the internal function Invoke-Command2 which uses New-PSSession when we run it against a remote computer. "Why have you changed it?" Let … Continue reading More PowerShell Remoting coverage in dbatools

“Ups…I have deleted some data. Can you put it back?” – dbatools for the rescue

Few days ago I received a request to restore a dozen of tables because someone have deleted more data than it was supposed. I immediately thought about dbatools for the job! NOTE: I also thought about SSMS "Import/Export Data". And this is ok when someone says "it's to run just once, just now". When you … Continue reading “Ups…I have deleted some data. Can you put it back?” – dbatools for the rescue