Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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