1

Hi I am trying to create a powershell script to automate the creation of a SP2010 site collection. I want to have an XML file that the script can use to create the top site, sub sites, Lists, etc.

Something like

    <Setup>
  <Sites>
    <TopSite>
      <Name>Site1</Name>
    </TopSite>
  </Sites>
  <Sites>
    <TopSite>
      <Name>Site2</Name>
      <Lists>
        <List>
          <Name>List1</Name>
          <Field>
            <Name>TestColumn1</Name>
            <Type>Text</Type>
          </Field>
          <Field>
            <Name>TestColumn2</Name>
            <Type>Text</Type>
          </Field>
          <Field>
            <Name>TestColumn3</Name>
            <Type>Text</Type>
          </Field>
          <Field>
            <Name>TestColumn4</Name>
            <Type>Text</Type>
          </Field>
        </List>
      </Lists>
    </TopSite>
    <SubSite>
      <Name>Subsite2a</Name>
      <Lists>
        <List>
        <List>
          <Name>List1</Name>
          <Field>
            <Name>TestColumn1</Name>
            <Type>Text</Type>
          </Field>
          <Field>
            <Name>TestColumn2</Name>
            <Type>Text</Type>
          </Field>
          <Field>
            <Name>TestColumn3</Name>
            <Type>Text</Type>
          </Field>
          <Field>
            <Name>TestColumn4</Name>
            <Type>Text</Type>
          </Field>
        </List>
      </Lists>
    </SubSite>
  </Sites>
</Setup>

IS there some ready script that I can use for this task?

1

I found this useful script.

http://www.sharepointedutech.com/2010/02/12/create-sharepoint-2010-sites-using-powershell-reading-an-xml-file/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.