SharePoint Management Shell Scripts for Beginners
SharePoint Management Shell Scripts for Beginners I had certain requirements to Create multiple Top Level Sites and felt that, for starters looping through a one line code would do the work. I would be adding in more Scripts here for other requirements too..!! 1.Given below is the Powershell Script for creating multiple Top-level Sites Add-PSSnapin "Microsoft.SharePoint.PowerShell" $url=$args[0] $name=$args[1] $ownerAlias=$args[2] $ownerEmail=$args[3] $template=$args[4] $language=$args[5] $siteCount=$args[6] ## SharePoint DLL [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") For($i=1; $i -le $siteCount; $i++) { Write-Output "Creating Top Level Site...!!!" New-SPSite -Url ($url+$i) -Name ($name+"-"+$i) -OwnerAlias $ownerAlias -OwnerEmail $ownerEmail -Template $template -Language $language -Verbose Write-Output "Top Level Site Created...!!!" } Remove-PSSnapin ...