You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bin/dbatools-index.json
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -635,7 +635,7 @@
635
635
"Synopsis": "Find database/s on multiple servers that match criteria you input",
636
636
"Name": "Find-DbaDatabase",
637
637
"Links": "https://dbatools.io/Find-DbaDatabase",
638
-
"Examples": "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDatabase -SqlInstance \"DEV01\", \"DEV02\", \"UAT01\", \"UAT02\", \"PROD01\", \"PROD02\" -Pattern Report\r\n\r\nReturns all database from the SqlInstances that have a database with Report in the name\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDatabase -SqlInstance \"DEV01\", \"DEV02\", \"UAT01\", \"UAT02\", \"PROD01\", \"PROD02\" -Pattern TestDB -Exact \r\n-Detailed\r\n\r\nReturns all database from the SqlInstances that have a database named TestDB with a detailed output.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDatabase -SqlInstance \"DEV01\", \"DEV02\", \"UAT01\", \"UAT02\", \"PROD01\", \"PROD02\" -Property ServiceBrokerGuid \r\n-Pattern \u0027-faeb-495a-9898-f25a782835f5\u0027 -Detailed\r\n\r\nReturns all database from the SqlInstances that have the same Service Broker GUID with a deatiled output\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
638
+
"Examples": "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDatabase -SqlInstance \"DEV01\", \"DEV02\", \"UAT01\", \"UAT02\", \"PROD01\", \"PROD02\" -Pattern Report\r\n\r\nReturns all database from the SqlInstances that have a database with Report in the name\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDatabase -SqlInstance \"DEV01\", \"DEV02\", \"UAT01\", \"UAT02\", \"PROD01\", \"PROD02\" -Pattern TestDB -Exact | \r\nSelect-Object *\r\n\r\nReturns all database from the SqlInstances that have a database named TestDB with a detailed output.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDatabase -SqlInstance \"DEV01\", \"DEV02\", \"UAT01\", \"UAT02\", \"PROD01\", \"PROD02\" -Property ServiceBrokerGuid \r\n-Pattern \u0027-faeb-495a-9898-f25a782835f5\u0027 | Select-Object *\r\n\r\nReturns all database from the SqlInstances that have the same Service Broker GUID with a deatiled output\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
639
639
},
640
640
{
641
641
"CommandName": "Find-DbaDatabaseGrowthEvent",
@@ -2686,6 +2686,15 @@
2686
2686
"Links": "https://dbatools.io/Remove-DbaSpn",
2687
2687
"Examples": "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaSpn -SPN MSSQLSvc\\SQLSERVERA.domain.something -ServiceAccount domain\\account\r\n\r\nConnects to Active Directory and removes a provided SPN from the given account (and also the relative delegation)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaSpn -SPN MSSQLSvc\\SQLSERVERA.domain.something -ServiceAccount domain\\account -EnableException\r\n\r\nConnects to Active Directory and removes a provided SPN from the given account, suppressing all error messages and \r\nthrow exceptions that can be caught instead\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaSpn -SPN MSSQLSvc\\SQLSERVERA.domain.something -ServiceAccount domain\\account -Credential \r\n(Get-Credential)\r\n\r\nConnects to Active Directory and removes a provided SPN to the given account. Uses alternative account to connect to AD.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eTest-DbaSpn -ComputerName sql2005 | Where { $_.isSet -eq $true } | Remove-DbaSpn -WhatIf\r\n\r\nShows what would happen trying to remove all set SPNs for sql2005 and the relative delegations\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eTest-DbaSpn -ComputerName sql2005 | Where { $_.isSet -eq $true } | Remove-DbaSpn\r\n\r\nRemoves all set SPNs for sql2005 and the relative delegations\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
2688
2688
},
2689
+
{
2690
+
"CommandName": "Rename-DbaDatabase",
2691
+
"Description": "Can change every database metadata that can be renamed.\nThe ultimate goal is choosing to have a default template to enforce in your environment\nso your naming convention for every bit can be put in place in no time.\nThe process is as follows (it follows the hierarchy of the entities):\n\t- database name is changed (optionally, forcing users out)\n\t- filegroup name(s) are changed accordingly\n\t- logical name(s) are changed accordingly\n\t- physical file(s) are changed accordingly\n\t\t- if Move is specified, the database will be taken offline and the move will initiate, then it will be taken online\n\t\t- if Move is not specified, the database remains online (unless SetOffline), and you are in charge of moving files\nIf any of the above fails, the process stops.\nPlease take a backup of your databases BEFORE using this, and remember to backup AFTER (also a FULL backup of master)\n\nIt returns an object for each database with all the renames done, plus hidden properties showing a \"human\" representation of them.\n\nIt\u0027s better you store the resulting object in a variable so you can inspect it in case of issues, e.g. \"$result = Rename-DbaDatabase .....\"\n\nTo get a grasp without worrying of what would happen under the hood, use \"Rename-DbaDatabase .... -Preview | Select-Object *\"",
2692
+
"Author": "niphlod",
2693
+
"Synopsis": "Changes database name, logical file names, file group names and physical file names (optionally handling the move). BETA VERSION.",
"Examples": "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -DatabaseName HR2 | select *\r\n\r\nShows the detailed resultset you\u0027ll get renaming the HR database to HR2 without doing anything\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -DatabaseName HR2\r\n\r\nRenames the HR database to HR2\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance sqlserver2014a -Database HR | Rename-DbaDatabase -DatabaseName HR2\r\n\r\nSame as before, but with a piped database (renames the HR database to HR2)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nRename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -DatabaseName \"dbatools_\u003cDBN\u003e\"\r\n\r\nRenames the HR database to dbatools_HR\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nRename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -DatabaseName \"dbatools_\u003cDBN\u003e_\u003cDATE\u003e\"\r\n\r\nRenames the HR database to dbatools_HR_20170807 (if today is 07th Aug 2017)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nRename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -FileGroupName \"dbatools_\u003cFGN\u003e\"\r\n\r\nRenames every FileGroup within HR to \"dbatools_[the original FileGroup name]\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nRename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -DatabaseName \"dbatools_\u003cDBN\u003e\" -FileGroupName \"\u003cDBN\u003e_\u003cFGN\u003e\"\r\n\r\nRenames the HR database to \"dbatools_HR\", then renames every FileGroup within to \"dbatools_HR_[the original FileGroup \r\nname]\"\r\nNote the \"default recursive behaviour\" here: for all intents and purposes the result of the former can be obtained with \r\ntwo distinct calls:\r\nRename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -FileGroupName \"dbatools_\u003cDBN\u003e_\u003cFGN\u003e\"\r\nRename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -DatabaseName \"dbatools_\u003cDBN\u003e\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nRename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -DatabaseName \"dbatools_\u003cDBN\u003e\" -FileName \"\u003cDBN\u003e_\u003cFGN\u003e_\u003cFNN\u003e\"\r\n\r\nRenames the HR database to \"dbatools_HR\" and then all filenames as \"dbatools_HR_[Name of the \r\nFileGroup]_[original_filename]\"\r\nThe db stays online (watch out!). You can then proceed manually to move/copy files by hand, set the db offline and then \r\nonline again to finish the rename process\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 9 --------------------------\r\n\r\nRename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -DatabaseName \"dbatools_\u003cDBN\u003e\" -FileName \r\n\"\u003cDBN\u003e_\u003cFGN\u003e_\u003cFNN\u003e\" -SetOffline\r\n\r\nRenames the HR database to \"dbatools_HR\" and then all filenames as \"dbatools_HR_[Name of the \r\nFileGroup]_[original_filename]\"\r\nThe db is then set offline (watch out!). You can then proceed manually to move/copy files by hand and then set it \r\nonline again to finish the rename process\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 10 --------------------------\r\n\r\nRename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -DatabaseName \"dbatools_\u003cDBN\u003e\" -FileName \r\n\"\u003cDBN\u003e_\u003cFGN\u003e_\u003cFNN\u003e\" -Move\r\n\r\nRenames the HR database to \"dbatools_HR\" and then all filenames as \"dbatools_HR_[Name of the \r\nFileGroup]_[original_filename]\"\r\nThe db is then set offline (watch out!). The function tries to do a simple rename and then sets the db online again to \r\nfinish the rename process\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
2697
+
},
2689
2698
{
2690
2699
"CommandName": "Rename-DbaLogin",
2691
2700
"Description": "There are times where you might want to rename a login that was copied down, or if the name is not descriptive for what it does. \n\nIt can be a pain to update all of the mappings for a specific user, this does it for you.",
0 commit comments