Hawawajui mtumiaji kundi katika MOSS 2007
code zifuatazo kuongeza mtumiaji tovuti na maalum kundi.
binafsi utupu AddUser(kamba strSite,kamba webGroup)
{
SPSecurity.RunWithElevatedPrivileges(mjumbe()
{
kutumia (SPSite tovuti = SPSite mpya(STRS))
{
kutumia (SPWeb mtandao = site.OpenWeb())
{
Boolean allowUnsafeUpdate = web.AllowUnsafeUpdates;
kujaribu
{
web.AllowUnsafeUpdates = kweli;
web.SiteUsers.Add(jina login, Barua pepe, loginId, “”);
web.Groups[webGroup].AddUser(jina login, Barua pepe, loginId, “”);
}
finally
{
web.AllowUnsafeUpdates = allowUnsafeUpdate;
}
}
}
});
}
BBC