SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.