{"id":1158,"date":"2019-11-20T08:00:00","date_gmt":"2019-11-20T14:00:00","guid":{"rendered":"http:\/\/www.sqlnuggets.com\/?p=1158"},"modified":"2019-11-20T08:03:50","modified_gmt":"2019-11-20T14:03:50","slug":"backing-up-databases-with-the-dbatools-powershell-module","status":"publish","type":"post","link":"https:\/\/sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/","title":{"rendered":"Backing Up Databases With The dbatools PowerShell Module"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-871\" src=\"https:\/\/sqlnuggets.com\/wp-content\/uploads\/2018\/09\/dbatools-logo-1.png\" alt=\"\" width=\"223\" height=\"64\">We do a lot of database backups and restores at work, outside of our regular backup routines. A lot! I&#8217;ve actually done as many as 40 in one day. Our &#8220;enterprise&#8221; backup system is too cumbersome to try to use like this, so we needed something that would allow us to take ad-hoc backups quickly and easily.&nbsp; This is where <a href=\"https:\/\/dbatools.io\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"dbatools (opens in a new tab)\">dbatools<\/a> really helps out. Here are few examples:<\/p>\n\n\n<h3 class=\"wp-block-heading\"><br>Backing Up A Single Database<\/h3>\n\n\n\n<p>Backing up a database (or multiple databases) is done by calling the <a rel=\"noreferrer noopener\" aria-label=\"Backup-DbaDatabase (opens in a new tab)\" href=\"https:\/\/docs.dbatools.io\/#Backup-DbaDatabase\" target=\"_blank\">Backup-DbaDatabase<\/a> command. The documentation is pretty straight forward, and a basic FULL backup command would be:<\/p>\n\n\n<pre class=\"lang:ps decode:true \">Backup-DbaDatabase -SqlInstance 'SQLServer01' -Database 'DBname' -Path '\\\\fileshare\\backups\\' -FilePath 'dbname.bak' -Type Full<\/pre>\n\n\n<p>Now, if you run the above script, there is a chance you would be met with the following errors, like I was:<\/p>\n\n\n<h4 class=\"block-editor-rich-text__editable editor-rich-text__editable\" role=\"textbox\" contenteditable=\"true\" aria-multiline=\"true\" data-is-placeholder-visible=\"false\" aria-label=\"Write heading\u2026\" aria-autocomplete=\"list\"><span style=\"color: #ff0000;\">Backup-DbaDatabase : A parameter cannot be found that matches parameter name &#8216;Path&#8217;. <\/span><br data-rich-text-line-break=\"true\"><span style=\"color: #ff0000;\">Backup-DbaDatabase : A parameter cannot be found that matches parameter name &#8216;FilePath&#8217;.<\/span><\/h4>\n\n\n<p>This just means that you are using an earlier version of the dbatools library, where &#8220;path&#8221; and &#8220;filepath&#8221; were referred to as &#8220;BackupDirectory&#8221; and &#8220;BackupFileName&#8221; instead.  This was changed with version 1.0.0 in June of 2019, so you can either upgrade your dbatools version (highly recommended) or use &#8220;BackupDirectory&#8221; and &#8220;BackupFileName&#8221; instead of  &#8220;path&#8221; and &#8220;filepath&#8221; in your command.<\/p>\n\n\n\n<p>Now, let&#8217;s make our script a little more versatile by using variables for the parameters. The below command will take a FULL COPY_ONLY backup of &#8220;DBname&#8221; on &#8220;SQLServer01&#8221; and place it in the &#8220;\\fileshare\\Backups\\&#8221; directory.<\/p>\n\n\n<pre class=\"lang:ps decode:true \">$server = 'SQLServer01'\n$database = 'DBname'\n$path = '\\\\fileshare\\Backups\\'\n$filePath = 'DBname.bak'\n\nBackup-DbaDatabase -SqlInstance $server -Database $database -Path $path -FilePath $filePath -Type Full -CopyOnly<\/pre>\n\n\n<h3 class=\"wp-block-heading\"><br>Backing Up Multiple Databases<\/h3>\n\n\n\n<p>Once you have the basic backup command working, dbatools makes it very simple to backup multiple databases using the same command.  All you need to do is specify a list of databases, and then remove the &#8211;<em>FilePath <\/em>parameter because it is only accepted for single database backups.<\/p>\n\n\n<pre class=\"lang:tsql decode:true \">$server = 'SQLServer01'\n$dblist = 'dbname01','dbname02','dbname03' \n$path = '\\\\fileshare\\Backups\\'\n\nBackup-DbaDatabase -SqlInstance $server -Database $dblist -Path $path -Type Full -CopyOnly<\/pre>\n\n\n<h3 class=\"wp-block-heading\"><br>Backing Up All Of The Databases<\/h3>\n\n\n\n<p>Backing up all of the databases on a server is even easier.  Just omit the <em>-Database<\/em> parameter and it will back up every database on the specified server.<\/p>\n\n\n<pre class=\"lang:ps decode:true  \">$server = 'SQLServer01' \n$path = '\\\\fileshare\\Backups\\' \n\nBackup-DbaDatabase -SqlInstance $server -Path $path -Type Full -CopyOnly<\/pre>\n\n\n<h3 class=\"wp-block-heading\"><br>Creating Directories Dynamically<\/h3>\n\n\n\n<p>In the previous examples we just wrote the backups to the root of a file share.  But sometimes you&#8217;ll want to organize or separate your backups based off of server name or database name or backup type. This is something else that dbatools makes very simple to do dynamically. This is done by using the &#8211;<em>ReplaceInName <\/em>parameter and then specifying keywords in your FilePath and Path strings. Per the <em>Backup-DbaDatabase<\/em> documentation:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>-ReplaceInName<br> If this switch is set, the following list of strings will be replaced in the FilePath and Path strings:<br> instancename &#8211; will be replaced with the instance Name<br> servername &#8211; will be replaced with the server name<br> dbname &#8211; will be replaced with the database name<br> timestamp &#8211; will be replaced with the timestamp (either the default, or the format provided)<br> backuptype &#8211; will be replaced with Full, Log or Differential as appropriate<\/p><\/blockquote>\n\n\n\n<p>So, expanding off of our last example, we can modify the $path variable to include these keywords and then specify the &#8211;<em>ReplaceInName <\/em>parameter.  As a safety net, we&#8217;ll also want to specify the <em>-BuildPath<\/em> parameter so that dbatools knows to create any directories that are missing from your path.<\/p>\n\n\n<pre class=\"lang:tsql decode:true \">$server = 'SQLServer01'\n$dblist = 'dbname01','dbname02','dbname03'\n$path = '\\\\fileshare\\Backups\\servername\\dbname'\n\nBackup-DbaDatabase -SqlInstance $server -Database $dblist -Path $path -Type Full -CopyOnly -ReplaceInName -BuildPath<\/pre>\n\n\n<p>This would create the &#8220;\\\\fileshare\\Backups\\SQLServer01\\dbname01\\&#8221; directory and place the  dbname01 backup in there, and then do the same for the other databases in the list.<\/p>\n\n\n\n<p>While these are very basic examples, you should start to get an idea of just how versatile and easy to use the <em>Backup-DbaDatabase<\/em> command is. I use it on a daily basis! I encourage you to read through the documentation and look at the examples there to find other useful features of this command.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We do a lot of database backups and restores at work, outside of our regular backup routines. A lot! I&#8217;ve actually done as many as 40 in one day. Our &#8230;<\/p>\n","protected":false},"author":2,"featured_media":841,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2,20],"tags":[11,10,66],"class_list":["post-1158","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backups","category-powershell","tag-backups","tag-database-maintenance","tag-dbatools"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Backing Up Databases With The dbatools PowerShell Module - SQL Nuggets<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Backing Up Databases With The dbatools PowerShell Module - SQL Nuggets\" \/>\n<meta property=\"og:description\" content=\"We do a lot of database backups and restores at work, outside of our regular backup routines. A lot! I&#8217;ve actually done as many as 40 in one day. Our ...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Nuggets\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-20T14:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-11-20T14:03:50+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png\" \/>\n\t<meta property=\"og:image:width\" content=\"670\" \/>\n\t<meta property=\"og:image:height\" content=\"250\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Eric Cobb\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cfgears\" \/>\n<meta name=\"twitter:site\" content=\"@sqlnugg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eric Cobb\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/\"},\"author\":{\"name\":\"Eric Cobb\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#\\\/schema\\\/person\\\/210536254addbc1b9d2d95dc1448b38a\"},\"headline\":\"Backing Up Databases With The dbatools PowerShell Module\",\"datePublished\":\"2019-11-20T14:00:00+00:00\",\"dateModified\":\"2019-11-20T14:03:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/\"},\"wordCount\":611,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#organization\"},\"image\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sqlnuggets.com\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/powershell4.png\",\"keywords\":[\"Backups\",\"Database Maintenance\",\"dbatools\"],\"articleSection\":[\"Backups\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/\",\"url\":\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/\",\"name\":\"Backing Up Databases With The dbatools PowerShell Module - SQL Nuggets\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/#primaryimage\"},\"image\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sqlnuggets.com\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/powershell4.png\",\"datePublished\":\"2019-11-20T14:00:00+00:00\",\"dateModified\":\"2019-11-20T14:03:50+00:00\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/#primaryimage\",\"url\":\"https:\\\/\\\/sqlnuggets.com\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/powershell4.png\",\"contentUrl\":\"https:\\\/\\\/sqlnuggets.com\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/powershell4.png\",\"width\":670,\"height\":250},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/backing-up-databases-with-the-dbatools-powershell-module\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.sqlnuggets.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Backing Up Databases With The dbatools PowerShell Module\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#website\",\"url\":\"http:\\\/\\\/www.sqlnuggets.com\\\/\",\"name\":\"SQL Nuggets\",\"description\":\"Nuggets Of SQL Server Knowledge\",\"publisher\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\\\/\\\/www.sqlnuggets.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#organization\",\"name\":\"SQL Nuggets\",\"url\":\"http:\\\/\\\/www.sqlnuggets.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/sqlnuggets.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/website-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/sqlnuggets.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/website-logo.jpg\",\"width\":320,\"height\":54,\"caption\":\"SQL Nuggets\"},\"image\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/sqlnugg\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ericcobb\\\/\"]},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#\\\/schema\\\/person\\\/210536254addbc1b9d2d95dc1448b38a\",\"name\":\"Eric Cobb\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg\",\"caption\":\"Eric Cobb\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/cfgears\"],\"url\":\"https:\\\/\\\/sqlnuggets.com\\\/author\\\/eric-cobb\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Backing Up Databases With The dbatools PowerShell Module - SQL Nuggets","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/","og_locale":"en_US","og_type":"article","og_title":"Backing Up Databases With The dbatools PowerShell Module - SQL Nuggets","og_description":"We do a lot of database backups and restores at work, outside of our regular backup routines. A lot! I&#8217;ve actually done as many as 40 in one day. Our ...","og_url":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/","og_site_name":"SQL Nuggets","article_published_time":"2019-11-20T14:00:00+00:00","article_modified_time":"2019-11-20T14:03:50+00:00","og_image":[{"width":670,"height":250,"url":"http:\/\/www.sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png","type":"image\/png"}],"author":"Eric Cobb","twitter_card":"summary_large_image","twitter_creator":"@cfgears","twitter_site":"@sqlnugg","twitter_misc":{"Written by":"Eric Cobb","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/#article","isPartOf":{"@id":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/"},"author":{"name":"Eric Cobb","@id":"http:\/\/www.sqlnuggets.com\/#\/schema\/person\/210536254addbc1b9d2d95dc1448b38a"},"headline":"Backing Up Databases With The dbatools PowerShell Module","datePublished":"2019-11-20T14:00:00+00:00","dateModified":"2019-11-20T14:03:50+00:00","mainEntityOfPage":{"@id":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/"},"wordCount":611,"commentCount":0,"publisher":{"@id":"http:\/\/www.sqlnuggets.com\/#organization"},"image":{"@id":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/#primaryimage"},"thumbnailUrl":"https:\/\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png","keywords":["Backups","Database Maintenance","dbatools"],"articleSection":["Backups","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/","url":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/","name":"Backing Up Databases With The dbatools PowerShell Module - SQL Nuggets","isPartOf":{"@id":"http:\/\/www.sqlnuggets.com\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/#primaryimage"},"image":{"@id":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/#primaryimage"},"thumbnailUrl":"https:\/\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png","datePublished":"2019-11-20T14:00:00+00:00","dateModified":"2019-11-20T14:03:50+00:00","breadcrumb":{"@id":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/#primaryimage","url":"https:\/\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png","contentUrl":"https:\/\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png","width":670,"height":250},{"@type":"BreadcrumbList","@id":"http:\/\/www.sqlnuggets.com\/backing-up-databases-with-the-dbatools-powershell-module\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.sqlnuggets.com\/"},{"@type":"ListItem","position":2,"name":"Backing Up Databases With The dbatools PowerShell Module"}]},{"@type":"WebSite","@id":"http:\/\/www.sqlnuggets.com\/#website","url":"http:\/\/www.sqlnuggets.com\/","name":"SQL Nuggets","description":"Nuggets Of SQL Server Knowledge","publisher":{"@id":"http:\/\/www.sqlnuggets.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.sqlnuggets.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/www.sqlnuggets.com\/#organization","name":"SQL Nuggets","url":"http:\/\/www.sqlnuggets.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.sqlnuggets.com\/#\/schema\/logo\/image\/","url":"https:\/\/sqlnuggets.com\/wp-content\/uploads\/2023\/11\/website-logo.jpg","contentUrl":"https:\/\/sqlnuggets.com\/wp-content\/uploads\/2023\/11\/website-logo.jpg","width":320,"height":54,"caption":"SQL Nuggets"},"image":{"@id":"http:\/\/www.sqlnuggets.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/sqlnugg","https:\/\/www.linkedin.com\/in\/ericcobb\/"]},{"@type":"Person","@id":"http:\/\/www.sqlnuggets.com\/#\/schema\/person\/210536254addbc1b9d2d95dc1448b38a","name":"Eric Cobb","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg","caption":"Eric Cobb"},"sameAs":["https:\/\/x.com\/cfgears"],"url":"https:\/\/sqlnuggets.com\/author\/eric-cobb\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png","jetpack_shortlink":"https:\/\/wp.me\/pdyDvE-iG","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1534,"url":"https:\/\/sqlnuggets.com\/setting-the-database-owner-compatibility-level-and-recovery-model-with-powershell\/","url_meta":{"origin":1158,"position":0},"title":"Setting The Database Owner, Compatibility Level, And Recovery Model With PowerShell","author":"Eric Cobb","date":"December 30, 2020","format":false,"excerpt":"One of the great things about dbatool is that it allows you to run commands against multiple things. Sometimes you may need to run the same command on every server, or every database on a server, or every database on every server (not recommended). Today we're going to look at\u2026","rel":"","context":"In &quot;Configurations&quot;","block_context":{"text":"Configurations","link":"https:\/\/sqlnuggets.com\/category\/configurations\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/12\/pexels-photo-97077.jpeg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/12\/pexels-photo-97077.jpeg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/12\/pexels-photo-97077.jpeg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/12\/pexels-photo-97077.jpeg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/12\/pexels-photo-97077.jpeg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/12\/pexels-photo-97077.jpeg?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":870,"url":"https:\/\/sqlnuggets.com\/getting-started-with-the-dbatools-powershell-module\/","url_meta":{"origin":1158,"position":1},"title":"Getting Started With The dbatools PowerShell Module","author":"Eric Cobb","date":"September 20, 2018","format":false,"excerpt":"If you are looking for a super easy way to start using PowerShell to manage your SQL Servers, then the\u00a0dbatools PowerShell module is for you!\u00a0 For those that aren't familiar, dbatools is a\u00a0free\u00a0PowerShell module with over 400 SQL Server best practice, administration, development and migration commands included. I have to\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/sqlnuggets.com\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":887,"url":"https:\/\/sqlnuggets.com\/using-dbatools-powershell-module-to-configure-sql-server\/","url_meta":{"origin":1158,"position":2},"title":"Using dbatools PowerShell Module To Configure SQL Server","author":"Eric Cobb","date":"October 9, 2018","format":false,"excerpt":"The more I use\u00a0the\u00a0dbatools PowerShell module, the more I like it.\u00a0 It really is a solid set of scripts that allow you to easily manage your SQL Servers via PowerShell.\u00a0 If you are not familiar with dbatools, I recommend you head over to my previous post,\u00a0Getting Started With The dbatools\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/sqlnuggets.com\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1513,"url":"https:\/\/sqlnuggets.com\/upcoming-geek-sync-practical-powershell-for-the-busy-dba\/","url_meta":{"origin":1158,"position":3},"title":"Upcoming Geek Sync: Practical PowerShell For The Busy DBA","author":"Eric Cobb","date":"November 10, 2020","format":false,"excerpt":"Be sure to sign up for my upcoming IDERA Geek Sync, Practical PowerShell For The Busy DBA on November 19th, 2020 at 11:00 AM CT. I will be focusing on using the dbatools PowerShell module, and show just how great it is at handling many of the tasks that SQL\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/sqlnuggets.com\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/11\/EmZ1VIOWMAMIy-r.jpeg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/11\/EmZ1VIOWMAMIy-r.jpeg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/11\/EmZ1VIOWMAMIy-r.jpeg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/11\/EmZ1VIOWMAMIy-r.jpeg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/11\/EmZ1VIOWMAMIy-r.jpeg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2020\/11\/EmZ1VIOWMAMIy-r.jpeg?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1049,"url":"https:\/\/sqlnuggets.com\/patching-multiple-sql-servers-with-powershell-and-dbatools\/","url_meta":{"origin":1158,"position":4},"title":"Patching Multiple SQL Servers With Powershell and dbatools","author":"Eric Cobb","date":"July 18, 2019","format":false,"excerpt":"Patching SQL Server can sometimes be a time consuming process, especially when you have multiple servers that need to be patched. Remoting in to each box to run through the update wizard is tedious, and if you have multiple patches to apply you're going to be spending a considerable chunk\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/sqlnuggets.com\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":897,"url":"https:\/\/sqlnuggets.com\/using-dbatools-powershell-module-to-set-maxdop-and-max-memory\/","url_meta":{"origin":1158,"position":5},"title":"Using dbatools PowerShell Module To Set MAXDOP And Max Memory","author":"Eric Cobb","date":"November 27, 2018","format":false,"excerpt":"As I continue my blog series on using\u00a0the\u00a0dbatools PowerShell module, today I want to discuss using it to set MAXDOP and Max Memory on your SQL Server.\u00a0 This builds directly off of my previous post on\u00a0Using dbatools PowerShell Module To Configure SQL Server, so if you haven't seen that one\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/sqlnuggets.com\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2018\/07\/powershell4.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/posts\/1158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/comments?post=1158"}],"version-history":[{"count":0,"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/posts\/1158\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/media\/841"}],"wp:attachment":[{"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/media?parent=1158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/categories?post=1158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/tags?post=1158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}