My Writings. My Thoughts.
SharePoint: How to remove a Content Database in SharePoint 2010 using PowerShell
// April 22nd, 2011 // No Comments » // PowerShell
Remove a Content Database is a common task as create a new one is. Content Databases can be removed when you are deleting a SharePoint Web Application and you are asked if you want to delete the content database and the IIS Application Pool of the Web Application. Other situations are also common, for example, when you need to migrate some content or after steps of backup and restore.
The following cmdlet is used to remove or delete a Content Database:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | PS C:\> Get-SPContentDatabase -Identity "ContentDB" | Remove-SPContentDatabase Confirm Are you sure you want to perform this action? Performing operation "Remove-SPContentDatabase" on Target "ContentDB". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):y Confirm Removing 'ContentDB' will permananetly delete the SQL database, permananetly deleting all content stored within it. Use Dismount-SPContentDatabase if you do not want to delete the SQL database. [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):y PS C:\> |
Use responsibly!
SharePoint: How to create a new Content Database in SharePoint 2010 using PowerShell
// April 14th, 2011 // No Comments » // PowerShell
Create new Content Databases is a common task for a SharePoint Administrator, usually when the self-service site creation is turned on and you want to keep your enviroment following the best practices…
The following cmdlet is used to create a new Content Database:
1 | PS C:\> New-SPContentDatabase -Name "NameOfTheContentDatabase" -WebApplication http://siteurl:port |
