Author: Mikey Bronowski

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

dbatools commands used in this post: Backup-DbaDatabase Restore-DbaDatabase Get-DbaDbBackupHistory Get-DbaBackupInformation Get-DbaLastBackup Get-DbaDbRestoreHistory Measure-DbaBackupThroughput New-DbaDbSnapshot Get-DbaDbSnapshot Restore-DbaDbSnapshot Remove-DbaDbSnapshot Backup Taking backup is an essential task for everyone working with any kind of data. SSMS offers a wide range of options for taking backups, and at least the same you can achieve using dbatools. SSMS dbatools: Backup-DbaDatabase…

Read More dbatools.io = command-line SQL Server Management Studio: Backup-Restore

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

Table of contents for the dbatools.io = command-line SQL Server Management Studio series. An overview of how to start using dbatools to run queries against your SQL Server instance.dbatools: Connect, Query and Save If you want to look at your SQL instance and see your objects here is how you can do it.dbatools: Let me…

Read More dbatools.io = command-line SQL Server Management Studio: Table of contents

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

dbatools commands used in this post: Rename-DbaDatabase Set-DbaDbOwner Set-DbaDbCompatibility Set-DbaDbRecoveryModel Set-DbaDbQueryStoreOption Set-DbaTempDbConfig Rename-DbaLogin Set-DbaLogin Set-DbaAgentJob Set-DbaAgentJobStep Set-DbaAgentJobOutputFile Set-DbaAgentJobOwner Invoke-DbaCycleErrorLog Set-DbaErrorLogConfig Change database The reasons to alter the database might be as many as different users. Some want to rename the old database, or maybe change the owner or recovery model after restoring the database. Enabling…

Read More dbatools.io = command-line SQL Server Management Studio: Request for change

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

dbatools commands used in this post: Remove-DbaDatabase Remove-DbaLogin Remove-DbaDbUser Remove-DbaDbRoleMember Remove-DbaDbRole Remove-DbaServerRole Remove-DbaAgentJobStep Remove-DbaAgentJob One note before we start dropping objects on the SQL Server. The dbatools commands support a -WhatIf switch (more about that here). I would encourage you to test it out, especially with commands that are removing things. Drop database Who does…

Read More dbatools.io = command-line SQL Server Management Studio: Drop it

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

dbatools commands used in this post: New-DbaDatabase New-DbaLogin New-DbaDbRole New-DbaDbUser New-DbaAgentJob New-DbaAgentJobStep New-DbaAgentSchedule New-DbaDbMailAccount New-DbaDbMailProfile New database Request for a new database is a pretty standard and repeatable task. It can be either a simple database based on the model database or more complex with multiple data files and filegroups. SSMS dbatools: New-DbaDatabase New login/user/role…

Read More dbatools.io = command-line SQL Server Management Studio: Something new

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

dbatools commands used: Get-DbaDatabase Get-DbaDbFile Get-DbaDbSpace Get-DbaDbState Get-DbaAgentJob Get-DbaAgentJobStep Get-DbaLogin Get-DbaDbUser Get-DbaServerRole Get-DbaServerRoleMember Get-DbaDbRole Get-DbaDbRoleMember See the databases When I want to quickly check the databases in the SSMS I would use this: SSMS With dbatools I can run the following command: dbatools: Get-DbaDatabase In a comparable way we can see details of a single…

Read More dbatools.io = command-line SQL Server Management Studio: Let me see

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

dbatools commands used in this post: Connect-DbaInstance Invoke-DbaQuery Write-DbaDbTableData Connect to the Database Engine It is possible in dbatools to create a server object and reuse it without providing the credentials and connecting to the instance again and again. SSMS dbatools: Connect-DbaInstance Execute a simple query Once the connection is established you can run the…

Read More dbatools.io = command-line SQL Server Management Studio: Connect, Query and Save

ImportExcel - PowerShell module ImportExcel - PowerShell module

Last week I have introduced you to ImportExcel PowerShell module and its capability to manipulate the worksheets and create pivot tables and pivot charts. This week let’s jump on some other features: conditional formatting and charts. ImportExcel – how to? If you have not installed the module before, use the below code to do so…

Read More PowerShell into Excel:ImportExcel Module Part 2

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

I am using dbatools.io in day-to-day work. That amazing set of tools helped me a lot. I have also met people who have some reservations or do not know where to start. I have heard: I will not learn new language, for example PowerShell SQL Server Management Studio is all I need We already have…

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

ImportExcel - PowerShell module ImportExcel - PowerShell module

While ago I needed to do some manipulation on Excel spreadsheets but had no Office installed on the server. For the specific case, I looked for a way to complete my task with the PowerShell. A quick look into Google search results and… Even though the name is not specified, both articles talk about the…

Read More PowerShell into Excel:ImportExcel Module Part 1