Thanks to several of our team members, we’re now progressing quickly towards dbatools 1.0! 🙌
The progress is so encouraging, I believe 1.0 is around the corner. Because of this, I wanted to let you all know that tomorrow, we’ll start introducing breaking changes.
Output Changes Things like output and parameter names will change. For example, the output for the command Get-DbaPrivilege will be updated. Currently, it looks like this:
During the month of October 2018 DigitalOcean is again running Hacktoberfest to support open source projects. They are offering a limited edition T-Shirt for any person making five pull requests to any public repo on GitHub.
To get a shirt, you must make five pull requests (PRs) between October 1–31 in any timezone. PRs can be to any public repo on GitHub, not just the ones highlighted. The PR must contain commits you made yourself.
Just a quick note that we’ve made more changes to align with 1.0, now available in version 0.9.453.
Renamed Log Shipping Get-DbaDbLogShipError Invoke-DbaDbLogShipping Invoke-DbaDbLogShipRecovery Test-DbaDbLogShipStatus
Registered Servers (Central Management Server) Add-DbaCmsRegServer Add-DbaCmsRegServerGroup Get-DbaCmsRegServer Get-DbaCmsRegServerGroup Get-DbaCmsRegServerStore Import-DbaCmsRegServer Move-DbaCmsRegServer Move-DbaCmsRegServerGroup Remove-DbaCmsRegServer Remove-DbaCmsRegServerGroup
And don’t forget, you can use Invoke-dbatoolsRenameHelper to rename commands in your scripts.
Get-ChildItem .\scripts | Invoke-dbatoolsRenameHelper New I’ll write about these more soon, but until then, enjoy this piping hot batch of new HA commands.
Now that you’ve convinced your security team that PowerShell improves your security posture, it’s time to learn PowerShell if you haven’t already.
Month of Lunches Learn PowerShell in a Month of Lunches Hands down, the one book most people recommend for learning PowerShell is Learn Windows PowerShell in a Month of Lunches by Don Jones and Jeffrey Hicks. You can buy the 3rd edition from Amazon or directly from Manning.
Last year, during our PASS Summit and SQL Bits precons, we highlighted the reasons that PowerShell is even more secure than GUI administration.
I even created a cute lil logo for it 😊
Recently, our team had a discussion about security in #dbatools-dev and I realized I should probably highlight why PowerShell and dbatools are ideal for every organization, including security-minded organizations.
If you’re questioned about PowerShell or dbatools, here are some handy facts to help prove we can help make your administration more, not less, secure.
A while back, I added some new features to our migration commands but I forgot to blog about them. Then, I used one of the new features for a fast and successful migration, got so pumped and had to share.
Multiple Destinations Now, you can migrate from one server to many. This applies to both Start-DbaMigration and all of the Copy-Dba* commands, including Copy-DbaDatabase and Copy-DbaLogin.
As you may be able to see in the title bar of this Out-GridView, I am migrating from workstation, which is a SQL Server 2008 instance, to localhost\sql2016 and localhost\sql2017.
Over the weekend, I presented a session in Glasgow called doomsday prepping with dbatools at SQLGLA, a community event hosted by Craig Porteous, sql_bob and Louise Paterson.
It was a lot of fun, even though the audience put no effort into winning the MRE give away
Now I’ve got some ready-to-eat beef tacos when the zombie apocalypse hits!
Down to Business When we talk about Disaster Recovery or DR, it’s often coupled with the term High Availability or HA.
We’ve been busy the past few days and have huge updates to share.
New Docs Site First, our new beta docs site is now up at docs.dbatools.io! Please check it out and let us know what you think.
This new docs site is auto-generated by our command help! Auto-generated docs were required because we’re adding so many new commands and updating so often, keeping our website up-to-date was just too time-consuming.
Marching onward to dbatools 1.0, a ton of commands have been renamed to align with our now mature naming scheme. These changes were made in today’s release, version 0.9.410 aka regularlegs, now available on GitHub and the PowerShell Gallery.
Here’s the general idea:
DbaDatabase has mostly been renamed to DbaDb with a couple exceptions DbaSql has been changed to just Dba, no exceptions. Considering Microsoft reserved the Sql prefix and we can’t use it, think of Dba as “Sql”.
Last night’s #PSPowerHour made me realize I should highlight a few awesome projects I’ve come across recently.
PSDatabaseClone PSDatabaseClone was created by Sander Stad.
PSDatabaseClone is a PowerShell module for creating SQL Server database images and clones. It enables administrator to supply environments with database copies that are a fraction of the original size.
It is well-documented and open-source.
dbops dbops was created by Kirill Kravtsov.
dbops is a Powershell module that provides Continuous Integration/Continuous Deployment capabilities for SQL database deployments.
Hey all! Kirill Kravtsov, here. I’m a SQL Server DBA that is passionate about automation and PowerShell. I’m also a major contributor to dbatools and creator of the dbops module, which provides continuous database deployments at any scale.
This week, I wrote an article on my blog and Chrissy asked me to mirror it on dbatools, so here we go.
Introduction Many SQL Server DBAs know that there is a very convenient way of delivering a full copy of the database structure to a different SQL Server: it’s called dacpac, or a Data-tier Application package.
Last night was the premiere of #PSPowerHour! It featured great speakers and a lot of dbatools content.
What is PSPowerHour? Created by Michael T Lombardi and Warren F, PSPowerHour is “like a virtual User Group, with a lightning-demo format, and room for non-PowerShell-specific content. Eight community members will give a demo each PowerHour.”
Sessions are proposed and organized on GitHub, which is really cool. Both new and seasoned speakers are invited to propose topics 🙌
Hey all, my name is Marcin and this is my first post and my first contribution to the dbatools. I hope you find it useful.
Introduction Part of a successful administration and management of any database is to know what happens over a period of time, when scheduled jobs and backups run and whether they are successful or not.
The common difficulty is getting this information out of SQL Server and then – the most difficult part – understanding what it means.
When connecting to a SQL Server instance with alternative credentials, it can be tedious to repeat the SQL credential over and over.
The great news is that this repetition is not required, as it can be handled instead by $PSDefaultParameterValues
Intro to $PSDefaultParameterValues $PSDefaultParameterValues is a hashtable available in PowerShell that can set defaults for any command that you run. In it’s simplest form, setting a default parameter value can look like this:
SQL Server’s Central Management Server (CMS), first introduced in SQL Server 2008, “stores a list of instances of SQL Server that is organized into one or more central management server groups”.
It’s a super useful feature that not all DBAs know about. Since CMS data is stored in msdb and accessible via SMO, you can access it from SQL Server Management Studio or PowerShell modules like dbatools.
Central Management Server’s essential functionality includes:
I remember the first time I saw database snapshots, I was so excited. Then I right-clicked in SSMS and..
No way to easily create a snapshot. So then I researched how to create one using T-SQL and I had to know the exact path. UGH.
CREATE DATABASE db1_snapshot_preupgrade ON (NAME = N'db1_snapshot_preupgrade_datafile', FILENAME = N'M:\MSSQL14.MSSQLSERVER\MSSQL\DATA\db1_snapshot_preupgrade.ss') AS SNAPSHOT OF db1 Intro to Snapshots Basically, database snapshots are similar to VM snapshots but for databases.
For those of you still using PowerShell ISE, I know the news about Microsoft no longer actively developing the ISE was sad. The good news is that it’s been replaced by something WAY cooler: VS Code.
VS Code is free, open-source and a joy to use. If you’d like to make the move, or if you just want to see how PowerShell Pros use VS Code, Rob Sewell will be presenting an hour long web session today for 24 Hours of PASS Summit Preview at June 12, 2018 at 20:00 GMT.
If you’re still using super old versions of SQL Server and don’t have access to awesome XEvents, we’ve got some commands to help simplify trace management.
Before I Begin Just a quick note, if you use newer versions of SQL Server and haven’t seen the XEvents Profiler in SSMS 17, it’s awesome! In my experience, it’s much faster than using Profiler and just as useful.
Sadly, however, it’s only available for SQL Server version 2012 and up.
Congrats to our teammate Rob Sewell! Rob was invited by PASS to present about PowerShell at PASS Summit 2018 on Tuesday, November 6 2018.
In his day-long session, Rob will talk about a variety of super interesting subjects including: dbachecks, PowerShell module-making, GitHub, VSTS, and dbatools. Rob is a vibrant, knowledgeable speaker and I can’t recommend this precon enough! I learn a ton every time that Rob and I present together.
SQL Server Operations Studio by Microsoft is like SSMS for ops, all open source and published on GitHub! They recently updated their wiki’s Performance page, addressing why SQL Operations Studio starts up slowly. Their startup stats are pretty cool!
This screenshot reminded me that I should write about our own import time stats.
Confession You may remember years ago when I expressed how upset I was about SQLPS, SqlServer’s predecessor, taking so long to import.