Shareoint Site Structure via Powershell and Excel

Welcome Forums General PowerShell Q&A Shareoint Site Structure via Powershell and Excel

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years, 8 months ago.

  • Author
  • #6409

    Topics: 1562
    Replies: 0
    Points: 0
    Rank: Member

    by bronyx85 at 2013-02-07 01:16:24


    Can someone advise on how I can create a site structure in SP13 ONLINE site structure using a Excel spreadsheet.

    i.e. my site structure is on the spreadsheet, so what I would like to do is tell powershell to look at the SpreadSheet and create the site collections, sites, lists and libraries which are on that spreadsheet.

    Is that possible?


    by DonJ at 2013-02-07 09:36:44

    Reading information from an XLS isn't impossible, but it can be pretty tricky. If you could export that to CSV, it becomes much easier – PowerShell has an Import-CSV command, and that'd let you get the data into the shell.

    $sites = Import-CSV sites.csv
    foreach ($site in $sites) {
    # refer to CSV columns like this: $, $site.whatever, assuming
    # "name" and "whatever" are columns from the CSV

    You can then use the data to run whatever commands you need to.

The topic ‘Shareoint Site Structure via Powershell and Excel’ is closed to new replies.