Checking For A Database Backup with PowerShell
Todays PowerShell Box of Tricks Post is about backups I highly recommend you go and read bookmark and come straight back Stuart Moore’s series on Backups with Powershell The link takes you to the...
View ArticleShow The Last Backups On A Server with PowerShell
Another day another PowerShell Box of Tricks post Auditors, managers and bosses often want proof of following processes successfully so when they come knocking on my door(I don’t have a door, it’s...
View ArticleWhat Runs on the SQL Server when you run a PowerShell script?–Question from...
Last week I ran a PowerShell lab at SQL Relay in Cardiff. There are still a few places available for SQL Relay week 2. Take a look here for more details and follow the twitter hashtag #SQLRelay for up...
View ArticleRefreshing Availability Group Database with PowerShell
Following last weeks post on Refreshing A Mirrored Database with PowerShell I thought I would write the script to refresh an Availability Group Database. An availability group supports a failover...
View ArticleScheduling Ola Hallengrens Maintenance Solution Default Jobs with Powershell
If you are a SQL Server DBA you should know about Ola Hallengren and will probably have investigated his Maintenance Solution. If you haven’t please start here https://ola.hallengren.com/ You can also...
View ArticleSetting Up and Using Azure VM SQL Automated Backup (and Restore)
This weekend I was creating some Azure VMs to test and was required to use the GUI for some screenshots. I have always used my Powershell scripts described here to create my test systems and with a new...
View ArticleUsing Power Bi with my DBA Database
Every good DBA should have a DBA database. A place to store information about all of their instances and databases. I have an InstanceList table which looks like this CREATE TABLE [dbo].[InstanceList](...
View ArticlePower Bi, PowerShell and SQL Agent Jobs
Continuing my series on using Power Bi with my DBA Database I am going to show in this post how I create the most useful daily report for DBAs – The SQL Agent Job report. You can get the scripts and...
View ArticleBacking up to URL container name – case is important
If you use SQL Backup to URL to backup your databases to Azure blob storage remember that for the container name case is important So BACKUP LOG [DatabaseName] TO URL =...
View ArticleChecking For A Database Backup with PowerShell
Todays PowerShell Box of Tricks Post is about backups I highly recommend you go and read bookmark and come straight back Stuart Moore’s series on Backups with Powershell The link takes you to the...
View ArticleShow The Last Backups On A Server with PowerShell
Another day another PowerShell Box of Tricks post Auditors, managers and bosses often want proof of following processes successfully so when they come knocking on my door(I don’t have a door, it’s...
View ArticleWhat Runs on the SQL Server when you run a PowerShell script?–Question from...
Last week I ran a PowerShell lab at SQL Relay in Cardiff. There are still a few places available for SQL Relay week 2. Take a look here for more details and follow the twitter hashtag #SQLRelay for up...
View ArticleDBA Database scripts are on Github
It started with a tweet from Dusty The second session I presented at the fantastic PowerShell Conference Europe was about using the DBA Database to automatically install DBA scripts like sp_Blitz,...
View ArticleUsing the new SQLServer Powershell module to get SQL Agent Job Information
So with the July Release of SSMS everything changed for using PowerShell with SQL. You can read the details here As I mentioned in my previous post the name of the module has changed to sqlserver This...
View ArticleRemove-SQLDatabaseSafely My First Contribution to DBATools
What is DBA Tools? A collection of modules for SQL Server DBAs. It initially started out as ‘sqlmigration’, but has now grown into a collection of various commands that help automate DBA tasks and...
View ArticleConverting SQL Agent Job Duration to TimeSpan using PowerShell
When you look in msdb for the SQL Agent Job duration you will find that it is an int. This is also the same when you look at Get-SQLAgentJobHistory from the sqlserver module. (You can get this by...
View ArticlePowerShell, Pester and Ola Hallengrens Maintenance Solution
If you are a SQL DBA you will have heard of Ola Hallengrens Maintenance solution If you haven’t go and click the link and look at the easiest way to ensure that all of your essential database...
View ArticleAltering 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...
View ArticleAdding 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...
View ArticleTesting 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...
View Article