.NET King Logo Comments on: Recreating SharePoint site collection using PowerShell
Skip Navigation Links
0 Items in Video cart!

Recreating SharePoint site collection using PowerShell (10/28/2015)

It happens quite often that you need to recreate entire site collection and recreate especially when you are developing Data Model (Lists/Libraries/Site Columns/Content Types), you need to recreate site collection and redeploy from scratch

Probably PowerShell is your best bet.

Below code deletes the site collection at http://sp2013dev/ and recreates another site collection with the root site template of Team Site (template ID: STS#0)

## Configuration information
$siteUrl = "http://sp2013dev/"
$siteOwner = "sp2013dev\someone"

Write-Host Deleting $siteUrl
Remove-SPSite -Identity $siteUrl -Confirm:$False
Write-Host Site collection successfully deleted
Write-Host Creating the team site
$TeamSitetemplate = Get-SPWebTemplate "STS#0"
New-SPSite -Url $siteUrl -OwnerAlias $siteOwner -Template $TeamSitetemplate
Write-Host site recreated

By: Fitflop Flower Sandals  
certainly like your web site but you have to check the spelling on several of your posts. A number of them are rife with spelling problems and I in finding it very bothersome to tell the reality however I'll surely come again again.
URL: http://www.fitflopssaleclearanceuk.com/fitflop-flower-sandals-c5.html  
By: Cheap NBA 2K17 MT for Sale  
You have a good taste.
URL: http://nba2kfeature.bloggets.net/released-nba-2k17-prelude-demo-with-career-mode/  
By: fifa 17 android coins  
Do not push me.
URL: http://www.emporio-m.com/Joomla/index.php?option=com_ccboard&view=postlist&forum=2&topic=11076&Itemid=67  
By: buy NBA 2K17 MT  
If I have the guts to quit my job .
URL: http://www.dateyou.me/blog/wonderful-experience/2016/10/07/nba-2k17-tricks--tips-layups-and-the-best-dunks_en.html  
By: fifa 17 coins  
Hold it!
URL: http://fffstrength.com.au/forums/viewtopic.php?f=5&t=66752  
By: fifa 17 comfort trade  
Call it even.
URL: http://carpetarota.com/blogs/37539/147512/petr-cech-fifa-17-rating-prediction  
By: buy albion silver on upalbion  
Proud of you .
URL: http://www.upalbion.com/albion/albion-online-silver  
By: fifa 17 coins for sale  
Call it even.
URL: http://uberant.com/article/189728-fifa-17-web-app-release-date-prediction/  
By: cheap fifa 17 coins  
I was thinking if after work we could grab a cup of coffee
URL: http://myslam.net/en/post/17634  
By: fifa 17 points  
You are so cute.
URL: http://u4fifa.soup.io/post/685497105/Customer-Service-Reviews-of-U4FIFA-com  
By: albion silver  
you have a good sense of humor.
URL: http://albiononline.blogcu.com/how-to-maximizing-albion-online-silver/21289362  
By: u4fifa reviews  
You are the savior of my life.
URL: https://www.webwiki.com/u4fifa.com  
By: The Division Dz Power Leveling  
Nobody can do a better job than you.
URL: http://www.snowgoosecentral.com/forum/viewtopic.php?f=2&t=525218  
By: blade and soul gold  
I've been through this!
URL: http://www.rcracer.com.au/phpbb3/viewtopic.php?f=13&t=100425  
Your name: