How to Setup AssociatedOwnerGroup / AssociatedMemberGroup / AssociatedVisitorGroup
在SharePoint 2010中,有时候会不小心将默认的3个组(AssociatedOwnerGroup / AssociatedMemberGroup / AssociatedVisitorGroup)给删除掉,如果想重新设置,可以有以下方法设置
1. Coding
using (SPSite spSite = new SPSite("SiteCollectionUrl"))
{
using (SPWeb spWeb = spSite.OpenWeb())
{
spWeb.AssociatedVisitorGroup = spWeb.Groups["VisitorsGroupName"];
spWeb.AssociatedMemberGroup = spWeb.Groups["ContributorGroupName"];
spWeb.AssociatedOwnerGroup = spWeb.Groups["OwnerGroupName"];
spWeb.Update();
}
}
{
using (SPWeb spWeb = spSite.OpenWeb())
{
spWeb.AssociatedVisitorGroup = spWeb.Groups["VisitorsGroupName"];
spWeb.AssociatedMemberGroup = spWeb.Groups["ContributorGroupName"];
spWeb.AssociatedOwnerGroup = spWeb.Groups["OwnerGroupName"];
spWeb.Update();
}
}
2. 页面
在2010中,隐藏了设置页面,不过可以直接通过URL访问。
[YourSiteURL]/_layouts/permsetup.aspx