Author: Mikey Bronowski

Wake me up when September ends Green Day Now I am fully awake and ready to contribute to the latest #TSQL2SDAY. This month’s host is Rob Volk (blog|twitter). Rob’s inspiration from Reddit ELI5 resulted in this great topic. AND vs OR Back in the days when I was tutoring math, I had two children who…

Read More T-SQL Tuesday #131: Data Analogies, or: Explain Databases Like I’m Five!

Roses are red,Violets are blue,Community loves dbatoolsdbatools love it too Author unknown what dbatools are? dbatools.io are a set of PowerShell commands to manage SQL Server, contained in a module. Plus it is open-source, created by people who work with the SQL Server and PowerShell for years. Some say it is a command-line version of…

Read More Install community tools with dbatools

Post thumbnail

Recently I have got a question about resources to learn PowerShell. There is plenty out there in the wild, but I came across an interesting module I would like to write today – PSKoans. What is PSKoans? The PSKoans module was created by Joel Sallow (blog|twitter) and here is its brief description taken from the…

Read More PSKoans – learn PowerShell with Pester

Saving emails attachments with PowerShell Saving emails attachments with PowerShell

Problem Save attachments from hundreds of emails received via Microsoft Outlook using PowerShell. Scenario One of the systems generates report daily and sends it out via email as an attachment, that is being saved in the Inbox subfolder MyAlerts. Sample email below. After 6 months someone decides to analyze all the reports from the attachments.…

Read More Saving Outlook attachments with PowerShell

dbatools = command-line SSMS dbatools = command-line SSMS

dbatools commands used in this post: New-DbaServiceMasterKeyBackup-DbaServiceMasterKeyNew-DbaDbMasterKeyGet-DbaDbMasterKeyBackup-DbaDbMasterKeyRemove-DbaDbMasterKeyNew-DbaDbAsymmetricKeyGet-DbaDbAsymmetricKeyRemove-DbaDbAsymmetricKeyNew-DbaDbCertificateGet-DbaDbCertificateBackup-DbaDbCertificateRemove-DbaDbCertificateRestore-DbaDbCertificate Service Master Key There are multiple security-related objects that are not easily accessible via SQL Server Management Studio. The first one would be Service Master Key, if exists, can be seen under the master database. Luckily, dbatools can help us to take a backup. SSMS dbatools: New-DbaServiceMasterKey dbatools:…

Read More dbatools.io = command-line SQL Server Management Studio: Keys, certificates

dbatools = command-line SSMS dbatools = command-line SSMS

dbatools commands used in this post: Get-DbaService Stop-DbaService Start-DbaService Restart-DbaService Start-DbaAgentJob Stop-DbaAgentJob New-DbaEndpoint Start-DbaEndpoint Stop-DbaEndpoint Start-DbaTrace Get-DbaTrace Stop-DbaTrace Start-DbaXESession Stop-DbaXESession SQL Services OK, let’s start. While doing some maintenance tasks there is a need to start/stop/restart SQL Services. Using SQL Server Configuration Manager is one way or even straight from SSMS, however, working with multiple…

Read More dbatools.io = command-line SQL Server Management Studio: Start/Stop

T-SQL-Tuesday T-SQL-Tuesday

This month Elizabeth Noble (blog|twitter) hosts the #TSQL2SDAY event (see the invitation) and would like to know how did you make your life easier by automating thing. Paper age There was this place I just started and wanted to request a day off. I asked people around how to do this, what system do we…

Read More T-SQL Tuesday #130: Automate Your Stress Away

dbatools = command-line SSMS dbatools = command-line SSMS

dbatools commands used in this post: Export-DbaScript Export-DbaUser Export-DbaLogin Export-DbaDacPackage Publish-DbaDacPackage Export-DbaInstance Copy-DbaDbTableData Export-DbaDbTableData Import-DbaCsv Script it out The SSMS offers to script out lots of the SQL Server objects, however it can be limited in some areas. Using Get-Dba* commands and piping them into Export-DbaScript may add few more options. For example SQL Agent…

Read More dbatools.io = command-line SQL Server Management Studio: Export-Import