Blog Archives

Customizing Remove-DbaBackup from dbatools


As a matter fact, it is not new that dbatools is a great PowerShell module for the SQL Server DBA, and from time to time they come up with new functions that for me I just think: Why I never thought about it before?

Today I want to talk about the function Remove-DbaBackup and more specifically my customized version of it. No, I didn’t rewrite Remove-DbaBackup but rather improved to my environment. The function by itself is just great and it addresses the goal of removing the backups nicely, but at the end, the function was not doing something that I wanted. Read the rest of this entry

Linking Data Sources to SSRS Reports with PowerShell

Imagine the following scenario: You just migrated a bunch of SSRS Reports to a new Reporting Services instance, which has a different folder structure. In this perspective, one of the things that get lost along the way is the linking between Data Sources and Reports.

If you are in the PowerShell world like me you know very well this repository in the Microsoft organization on Github: ReportingServicesTools.

Reporting Services Tools is a module that interacts with Microsoft SQL Server Reporting Services, making it easier several tasks like importing and exporting reports, creating folders, subscriptions, data sources and so on. The module is maintained by Microsoft along with some know PowerShell folks from the community like my friend Claudio Silva(@claudioessilva) from the dbatools team. Read the rest of this entry

I’m speaking at SQL Saturday Gothenburg 2018

SQLSaturday #775 - Gothenburg 2018 Hello Everyone!

Next weekend on 15th of September, I will be in Gothenburg for the SQL Saturday 775 or SQL Saturday Gothenburg!

There will be more than 15 sessions with all kinds of flavours, so you experiment a bit of everything 🙂 If you are in the area of Gothenburg I am sure you don’t wanna miss the event!

For me it will be a pleasure to be for my first time in Sweden and have the honor to speak there. I’m really excited! Read the rest of this entry

Removing Databases from Availability Groups with Powershell

Those days at work I had to remove a bunch of databases from the Availability Groups and later drop them from the primary and secondary replicas. I know I could do the click, click and drop thing, but why not PowerShell? Read the rest of this entry

Synchronize Files and Folders using Powershell

Hello everyone!

Last week I was helping an Application Admin to Synchronize files and folders between Source and Destination Servers. The challenge was because some folders had really long hierarchies, so you could imagine something like this.


I would say that doing this for some files it is really ok, but for my case we are talking about of 10GB of data and around 4K folders in the root level. Basically, this was the solution that I was able to come up.
The script in in the Github link below.
Read the rest of this entry

My Lightining Talk at SQL Saturday Vienna 2018


Hello everyone!

I just wanted to share that I will be presenting a Lightining Talk at SQL Saturday 679 in Vienna, Austria. I will have 10 minutes to present the following session.

Title: My 5 favorite Powershell Commands!

So, if you are planning to be in Vienna for the SQL Saturday, make sure to register yourself, as there are only a few spots available. Also, if you are a DBA, I would say that you really should be attending my Lightining Talk, because the commands that I am gonna show you will save your life.. or at least make it easier.

Also, look at the Event Agenda, as there will be many other sessions in all areas of the Data Platform world.

See you in Vienna!

Looking at dbatools github with Power BI

First of all! Really, really thanks dbatools team for this. I don’t have words to describe the impact that you guys have in my job. I use it every single day!

Now… back to the subject..

Those days I was preparing myself for a presentation and started to play around with Online Services Content Packs and decided to use the GitHub App Connector that is available.

In the left bottom of the Power BI area you have the Get Data option.


Once the page is opened you should choose Services and click on GET.


In the search bar just type Github. In the Github connector click on Get it now


Now the fun begins. What about if you want to have a look at your favorite DBA Powershell  Gallery? Off course I am talking about Read the rest of this entry

Iniciando no PowerShell para o Azure

Olá pessoal!

Já faz um tempinho que PowerShell está presente na vida de qualquer administrador de infraestrutura e até mesmo na do Administrador de Banco de Dados. E com o Microsoft Azure não seria diferente, temos diversos comandos em PowerShell e as possibilidades de administração/configuração do ambiente são imensas quando falamos de PowerShell.

Sendo assim, hoje eu gostaria de mostrar para você como deixar a sua máquina e o PowerShell é claro prontos para trabalharem com o Microsoft Azure. Vou colocar os passos a serem realizados logo abaixo. Read the rest of this entry

Retornando o status do serviço via PowerShell

Olá pessoal,

Passando aqui apenas para compartilhar mais um simples script PowerShell com vocês. A intenção do script é varrer uma lista de servidores de SQL Server e retornar apenas os serviços que estiverem com o status de stopped. O Script utiliza o cmdlet Get-Service. Read the rest of this entry

Retornando contas de serviço via PowerShell

Olá Pessoal,

Meus skills de desenvolvedor são horriveis, mas me deparei com uma situação no trabalho aonde eu não poderia realizar tal tarefa manualmente, pois seria muito dificil e muito chato de realizar e partindo dessa ideia me surgiu então o PowerShell. Não preciso falar muito como o PowerShell ajuda no dia-a-dia de um Administrador de Banco de Dados, ou de qualquer outra tecnologia Microsoft.

Para SQL Server não preciso mencionar que se alguem quiser aprender sobre PowerShell o blog do Laerte Junior (Twitter|Blog) onde você encontra muita coisa boa. Voltando para o meu problema eu precisava realizar a seguinte tarefa. Read the rest of this entry