Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

SQL DBA With A Beard

Rob is a SQL Server DBA currently supporting several hundred databases ranging from SQL 2000 to SQL 2012. Rob has a fabulous beard and loves to use Powershell to make his life easier.

Getting SQL Server File Sizes and Space Used with dbatools

I read a great blog post about answering the question how big is the database using T-SQL on SQL Buffet and wondered how much I could do with the dbatools module

The dbatools module (for those that don’t know) is a PowerShell module written by amazing folks in the community… Read more

0 comments, 75 reads

Posted in SQL DBA With A Beard on 29 March 2017

Test your Sqlserver backups on Linux with PowerShell and dbatools

I have written about Test-DbaLastBackup in posts here, here and here. They have been Windows only posts.

With SQL Server vNext CTP 1.4 now available and providing SQL Agent capability on Linux, I wrote here about using Ola Hallengrens scripts on Linux SQL Servers so can Test-DbaLastBackup work… Read more

0 comments, 68 reads

Posted in SQL DBA With A Beard on 27 March 2017

Using Pester with dbatools Test-DbaLastBackup

In previous posts I have shown how to use Test-DbaLastBackup from dbatools and how you can make use of the results. Today we will look at using  Pester with the results

Pester provides a framework for running unit tests to execute and validate PowerShell commands from within PowerShell.…

Read more

1 comments, 108 reads

Posted in SQL DBA With A Beard on 25 March 2017

Backing up SQL Server on Linux using Ola Hallengrens Maintenance Solution

With the release of SQL Server vNext CTP 1.4 SQL Agent was released for use on Linux. To install it on Ubuntu you need to upgrade your SQL Server to CTP 1.4. On Ubuntu you do this with

sudo apt-get update
sudo apt-get install mssql-server

Once you have CTP 1.4… Read more

0 comments, 117 reads

Posted in SQL DBA With A Beard on 22 March 2017

Taking dbatools Test-DbaLastBackup a little further

In a previous post I showed how easy it is to test your backups using Test-DbaLastBackup

Today I thought I would take it a little further and show you how PowerShell can be used to transmit or store this information in the manner you require

Test-DBALastBackup returns an object of… Read more

2 comments, 98 reads

Posted in SQL DBA With A Beard on 22 March 2017

Testing Your SQL Server Backups the Easy Way with PowerShell & dbatools

In a previous post I wrote about how easy it was to restore a whole SQL Servers user databases from a  directory using the dbatools module. Maybe it is a good idea to look at for disaster recovery scenarios but even PowerShell is going to be useless if your backups… Read more

3 comments, 204 reads

Posted in SQL DBA With A Beard on 20 March 2017

Restoring an entire SQL Server user databases with PowerShell using dbatools

All the good DBAs backup their databases.

A significant amount of SQL DBAs use Ola Hallengrens maintenance solution to do so.

This gives a folder structure like this


In my lab I had installed SQL 2016 on a server running Server 2016 TP5 which expired so I needed to… Read more

1 comments, 1,246 reads

Posted in SQL DBA With A Beard on 18 March 2017

Adding a PowerShell Job Step to an existing SQL Agent Job Step with PowerShell

In my last post I showed how to add a T-SQL Job step to an existing SQL Agent Job. The process is exactly the same for a PowerShell job step.

As before I gathered the required jobs using Get-SQLAgentJob command from the sqlserver module which you can get by installing… Read more

0 comments, 291 reads

Posted in SQL DBA With A Beard on 13 March 2017

VS Code PowerShell Snippets

Just a quick post, as much as a reminder for me as anything, but also useful to those that attended my sessions last week where I talked about snippets in PowerShell ISE

Jeff Hicks wrote a post explaining how to create snippets in VS Code for PowerShell

I love using… Read more

0 comments, 1,425 reads

Posted in SQL DBA With A Beard on 12 March 2017

Quickly Creating Test Users in SQL Server with PowerShell using the sqlserver module and dbatools

One of the most visited posts on my blog is nearly two and half years old now – Add User to SQL Server Database Role with PowerShell and Quickly Creating Test Users. I thought it was time to update it and use the latest sqlserver module and the dbatools… Read more

0 comments, 740 reads

Posted in SQL DBA With A Beard on 6 March 2017

SQL VNext sp_configure on Windows and Linux with dbatools

This weekend I set up some SQL vNext virtual machines, two on Windows and one on Linux so that I could test some scenarios and build an availability group.

IMPORTANT NOTE :- The names of dbatools commands with a Sql prefix WILL CHANGE in a later release of dbatools. dbatools… Read more

4 comments, 1,105 reads

Posted in SQL DBA With A Beard on 27 February 2017

Adding a T-SQL Job Step to a SQL Agent Job with PowerShell

In my last post, I explained how to alter an existing job step across many servers. I also had cause to add a T-SQL Job step to a large number of jobs as well. This is how I did it.
As before I gathered the required jobs using Get-SQLAgentJob… Read more

5 comments, 1,248 reads

Posted in SQL DBA With A Beard on 20 February 2017

Altering a Job Step on Hundreds of SQL Servers with PowerShell

I flew to Utrecht last week to present with Chrissy LeMaire and Sander Stad to present to the joint Dutch SQL and PowerShell User Groups. Whilst I was sat at the airport I got a phone call from my current client. “We need to change the backup path for all… Read more

5 comments, 201 reads

Posted in SQL DBA With A Beard on 13 February 2017

Using the PowerShell SQL Provider with SQL Authentication

Whilst having a conversation with Chrissy LeMaire last week about using the SQL Provider. She asked if it could use SQL Authentication. I had no idea but said I would find out. This is how and what I did.

I am going to demonstrate this in Visual Studio Code with… Read more

0 comments, 220 reads

Posted in SQL DBA With A Beard on 12 January 2017

A Whole Day of PowerShell and SQL – Join Chrissy LeMaire & I at #sqlsatvienna

SQL Saturday Vienna 2017 is only just around the corner.

On Friday, January 20, 2017, a lot of local and international speakers will gather to deliver sessions relating to SQL Server and all related services. It’s a fabulous agenda – take a look I am sure that it will be… Read more

1 comments, 166 reads

Posted in SQL DBA With A Beard on 9 January 2017

Running SQL Queries with Visual Studio Code

Reading this blog post by Shawn Melton Introduction of Visual Studio Code for DBAs reminded me that whilst I use Visual Studio Code (which I shall refer to as Code from here on) for writing PowerShell and Markdown and love how easily it interacts with Github I hadn’t tried T-SQL.… Read more

2 comments, 2,267 reads

Posted in SQL DBA With A Beard on 5 January 2017

2016 – That was a Year :-)

Its the time of year for reflection and I have had the most amazing 2016, I am blessed that I love what I do so much. I thoroughly enjoy writing and talking and sharing and commenting and supporting and cherishing all the SQL and PowerShell things. I wrote about using… Read more

0 comments, 203 reads

Posted in SQL DBA With A Beard on 2 January 2017

Deploying a Windows Data Science Virtual Machine to Azure with PowerShell easily

This weekend (10 December 2016), I went to Slovenia for a SQL Saturday. As always, it was an amazing event well organised by Mladen Prajdic, Dejan Sarka, and Matija Lah in a fabulous setting amongst fabulous scenery. I highly recommend it and, also, Ljubljana  is a wonderful… Read more

0 comments, 336 reads

Posted in SQL DBA With A Beard on 18 December 2016

Enabling Cortana for dbareports PowerBi

Last week at the Birmingham user group I gave a presentation about PowerShell and SQL Server

It was a very packed session as I crammed in the new sqlserver module, dbatools and dbareports On reflection I think this is a bit too much for a one hour session but… Read more

2 comments, 1,341 reads

Posted in SQL DBA With A Beard on 13 November 2016

Speaking? You? Go on. #tsql2sday #84

This is a blog post for this month’s T-SQL Tuesday post, hosted by Andy Yun (b|t). T-SQL Tuesday is a monthly blog event started by Adam Machanic (b|t). The T-SQL Tuesday topic this month was about advice for new speakers. Thanks… Read more

3 comments, 164 reads

Posted in SQL DBA With A Beard on 8 November 2016

Older posts