Using PowerShell in SharePoint 2010 – First steps
Hello @all,
today i play a bit with our new powershell cmdlets in O14.
1) how to get a list of all available cmtlets?
Answer: get-help *
(i prefer to write the output into a text file by: get-help * > c:\o14_pws_cmdlet.txt)
As next step how to create new contentdbs, attach, detach and remove them
2) How to create new contentdb for a web application:
Answer: New-SPContentDatabasee.g: New-SPContentDataBase –webapplication https://o14-4514 –Name o14_4514_WSS_Content_3
3) enumerate all contentdbs of one WebApplication:
Answer: GET-SPContentDatabase –webapplication https://o14-4514
4) how to detach a contentdb?
Answer: Dismount-SPcontentdatabase –identity <GUID>
5) how to attach a contentdb?
Answer: mount-SPcontentdatabase –name o14_4514_WSS_content_3 –webapplication <url>
The next command is new, please be careful with
6) how to delete a database on SQL server?
Answer: Remove-SPcontentdatabase –identify <guid>Now , take a look on SQL Server: *RIP for “o14_4514_WSS_content_3”, it’s deleted on SQL server
Regards
Patrick
Comments
Anonymous
May 13, 2010
Patrick, your blog did the trick for me... i migrated and it workedddddddddddddd.... voilaaaaaaaaaaaaaaaaaaaa thanks u. with my regards; Mai Omar.Anonymous
September 07, 2011
Hi, how to remove-spcontentdatabse without confirm ? thanksAnonymous
September 09, 2011
The comment has been removed