Skip to content

Instantly share code, notes, and snippets.

@stinaq stinaq/create-sites.ps1 Secret
Last active Dec 26, 2015

Embed
What would you like to do?
Script that creates a large number of SharePoint sites
#Script that creates a large number of SharePoint sites
#Get the template
$template = Get-SPWebTemplate "STS#0"
#Get user
$admin = "domain\admin"
#Create a large list of site names
$names = "Chili", "Cloudberry", "Coconut", "Damson", "Date", "Dragonfruit", "Durian", "Elderberry", "Feijoa", "Fig", "Gooseberry", "Grape", "Grapefruit", "Guava", "Huckleberry", "Honeydew", "Jackfruit", "Jettamelon", "Jambul", "Jujube", "Kiwi fruit", "Kumquat", "Legume", "Lemon", "Lime", "Loquat", "Lychee", "Mango", "Canary melon", "Cantaloupe", "Watermelon", "Rock melon", "Nectarine", "Nut", "Orange", "Clementine", "Mandarine", "Tangerine", "Papaya", "Passionfruit", "Peach", "Pepper", "Persimmon", "Physalis", "Pineapple", "Pomegranate", "Pomelo", "Purple Mangosteen", "Quince", "Raspberry", "Rambutan", "Redcurrant", "Satsuma", "Star fruit", "Strawberry", "Tamarillo", "Tomato", "Adrastea", "Alaskahallon", "Apelsin", "Aprikos", "Aubergine", "Avokado", "Backsmultron", "Bigarrå", "Bittergurka", "Bittermandel", "Björnbär", "Blodpomelo", "Blåbär", "Blåhallon", "Boysenbär", "Brakved", "Brödfrukt", "Bäverbär", "Blodapelsin", "Cashewnöt", "Cayennepeppar", "Charantais", "Chilipeppar", "Citron", "Dadel", "Drakfrukt", "Druvfläder", "Dvärgapelsin", "Ekollon", "Ekorrbär", "Enbär", "Fikonkaktus", "Fjällodon", "Fläder", "Fotblad", "Galiamelon", "Granatäpple", "Grapefrukt", "Greve moltke", "Gul kiwi", "Gurka", "Hagtorn", "Hallon", "Hasselnöt", "Hirskorn", "Hjortron", "Honungsmelon", "Indiskt marmeladträd", "Japansk dvärgapelsin", "Jordgubbe", "Jordnöt"
#Then create a site for each name in your list
foreach($site in $names)
{
Write-Host "Now creating site " + $site
$url = "http://dev/projects/" + $site
$newSite = New-SPSite -Url $url -OwnerAlias $admin -Template $template -Name $site
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.