Thursday, 14 October 2010

Create multiple SharePoint sites with permissions using a CSV file and PowerShell

When defining hierarchical structures, I personally prefer using an XML file, but there is still a place for the good old Comma-separated values (CSV) format. Firstly, it is easier to create and modify a CSV file – especially when using an application like Excel – and as the format has been around for a while, most people find it easier to read and understand. Despite its flaws, this must be the major reason why Microsoft decided to use CSV as the format for the Managed Metadata import file in SharePoint 2010.

Now we have the New-SPWeb PowerShell cmdlet introduced in SharePoint 2010, creating individual sites and sub-sites is easy enough to do without needing to visit the browser UI, but you still need to put in a bit of work if you are looking to create an entire site hierarchy using PowerShell.

To help you out, I have uploaded a “Create SharePoint Sites from CSV” PS1 script file to Codeplex for download. This script can be used to create multiple SharePoint sites in bulk from a CSV file and also set permissions on each site during creation.

It includes the following features:

  • Choose any site from which to start creating sub-sites
  • Create a full site hierarchy with sub-sites down to three levels from the start site
  • Specify a site title, description, and URL name
  • Specify whether to inherit parent site top navigation bar
  • Specify whether to inherit parent site permissions
  • If breaking permission inheritance, specify whether to add new permissions from scratch or by copying over permissions from the parent site and adding to those
  • Assign site permissions to SharePoint groups, Active Directory users or Active Directory groups, specifying the permission level required
  • Create the specified SharePoint group or Active Directory account in the site, if they do not already exist


You can download the script, documentation and an example CSV file at As always, I welcome any comments, suggestions, ideas or contributions for any new features if you have them.


  1. Hi,

    Is it possible to creates sites with powershell based on a csv file and custom site templates that are stored in the Solution gallery?.

  2. Hi - you will need to use the script I refer to above in combination with this script from darko -

  3. Phil - Love the site. I'm using the script above to create a large number of sites. When the script gets to the permissions area it errors out anytime I attempt to add a new SPGroup (doesn't exist / create new). If I add a SPGroup that exist it does great. What do I need to look at?

    Thank you!

  4. Hi, you could try adding the group to the site collection first as part of the script:

  5. Hi Phil,

    It is a great post. I'm having a problem when I'm using custom Site Template. Is there any way to use custom Site Template?


    1. Hi Volmiro, I have already answered this question above....

    2. Phil,

      My mistake, I think I checked the site before and I have just skipped because there are so many things on the site. :( I'm looking for it now. Thank You

      Again, it is a great post, and it is crucial to environment.



  6. Hi Phil

    Thanks for this great script! I did install the script and ran the commands per the instructions. However i get an error -> "The script has stopped because there has been an error". Any suggestions on what i am doing wrong ? Thanks!

    1. Forgot to mention above that the site gets created but the error shows up while trying to create the groups. I am not inheriting permissions from the parent site and trying to create new groups. Under Site permissions of the site, i only see the system account with full control. No other groups get created

  7. Does anybody know if this works with SP2013?

  8. I'm currently testing with SP2013, I had it working yesterday and managed to create ~20 sites each with 5 subsites, today it is refusing to do anything, getting error "The script has stopped because there has been an error" as soon as the script tries to run but I cannot determine why.

  9. I found the reason - the instructions say to use "team site" as template name for -SiteTemplate, I found I had to use the corresponding code instead, for team site this is STS#0

    To find the codes for templates type:

    Get-SPWebTemplate | Sort-Object "name"

    in the Management Shell, this will list all codes for default templates.

  10. With football we always have exciting games such as head soccer and head soccer unblocked and soccer heads and head soccer 2 or big head basketball big head soccer or head soccer will bring to everyone the good entertainment Best.

  11. you can dowmload here more and more..........
    ccleaner crack
    CCleaner is the number-one tool for cleaning your Windows PC. It protects your privacy online and makes your computer faster and more secure....

    Aurora HDR 2018 With Full Crack
    Aurora HDR 2018 is a handy photography editor which has got some advanced tools for creating some stunning portraits as it relies on the innovative technology.

    Camtasia Studio 9.1 Crack is a very famous and great effective display screen recording software that creates the video on-screen.

  12. Great article! That is the kind of information that are
    meant to be shared across the net. Disgrace on the seek engines for no longer positioning this post higher!
    Come on over and seek advice from my website . Thank you =)

    TeamSpeak 2018
    ZipGenius 2018
    Platform Update 2018
    FotoSketcher 2018
    Stick Wars (Hacked Version) 2018
    NTLite Enterprise with Crack

  13. También puede visitar una tienda de ladrillo y mortero de Michael Kors o su sitio web y comprar directamente un bolso Michael Kors desde allí. Usar un bolso de Michael Kors les permite a los demás reconocer que el habitante urbano educado toma la moda realmente con seriedad. Los bolsos de hombro son particularmente refinados y elegantes.

    {Bolsas Michael Kors Precios | Bolsos Michael Kors Outlet | Michael Kors Rebajas}

    En vacker konstnärlig skapelse av vävt läder, som ger ett skalskaligt utseende - liknar en snakeskin eller fiskhud, linjer utsidan av påsen. Läderens bältros är små läderringar. Det finns också gyllene accenter på väskan. Slutresultatet är svagt liknar kedjepost.

    {Michael Kors Rea | Michael Kors Väska Rea | Michael Kors Plånbok}

  14. I can only express a word of thanks. Because with the content on this blog I can add knowledge I, thank has been sharing this information. Do not forget to visit our website to share information and knowledge about health. |
    cara mengobati kelenjar getah bening |
    obat pusing berkepanjanagn |
    cara mengobati mata ikan |
    obat oles penyakit dompo |
    obat penyakit ispa