0
votes

I have created a SharePoint (MOSS 2007) site template, and I am programmatically creating a number of new site based on this template. I would like to populate each site created with this template with a number of users and groups from the Active Directory. Can anyone offer any guidance on how this can be done, either as part of the site template, or through code?

Thanks, MagicAndi.

1
By "Site Template" do you mean a Site Template saved from the GUI, or do you mean a "Site Definition" that you created with XML (onet.xml, etc.)?anchorpoint
AnchorPoint, it is a site template created using the SharePoint GUI. If you are saying that a site definition could provide a way to do this, I would consider creating one.MagicAndi
You cannot perform actions in code if the site template was created by saving it as a template.. Also, you cannot add users declaritevely in XML in a site definition, Code is the only way to do this..Colin

1 Answers

3
votes

Have a look at this article, it shows 3 different ways of adding users.

MOSS: Add user to site through code (programmatically)