Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Moving users from one sharepoint group to another

  Asked By: Sampat    Date: Mar 18    Category: Sharepoint    Views: 12062

It is possible to move user(s) from one sharepoint group to another in site
collection? I would like to move all users from Visitor group to Member group
but can't seem to find a way to do it and not sure if it possible to do so.

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Lizbeth Macdonald     Answered On: Mar 18

There isn't a move  operation for users  between groups - just add to
Members and delete from Visitors.

 
Answer #2    Answered By: Cole Curtis     Answered On: Mar 18

You could write a custom program that would do it, but there is nothing built in
that has this capability.

 
Answer #3    Answered By: Debbie Snow     Answered On: Mar 18

This may be a silly question.why not rename the group  to something like
Member2 and give it Contribute. Then create another "Visitors" group with
Read.

 
Answer #4    Answered By: Adalberto Merrill     Answered On: Mar 18

In the Member group  click Select All then choose Actions > E-mail Users.
From the resulting e-mail message, copy all of the entries in the To box.
Go to the Visitors group click New and paste the names.
Remove the entries from the Members group.

 
Answer #5    Answered By: Kuljit Dhinga     Answered On: Jun 20


check the forum below, it contains some useful information

social.technet.microsoft.com/.../95331a32-9f87-46c5-a2d0-3034b2ccde69

 
Answer #6    Answered By: Kuldeep Kothari     Answered On: Jun 20

In order to move users from Site Collection to other.

private static bool GetUsers(string original_sitename, string original_groupname,string destination_sitename, string destination_groupname)
{
try
{
bool flag = false;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite spSite = new SPSite(original_sitename))
{
using (SPWeb spWeb = spSite.OpenWeb())
{

try
{
SPUserCollection spusers = null;
spusers = spWeb.SiteGroups[original_groupname].Users;
int count = spusers.Count;
if (count > 1)
{
SPSite destSite = new SPSite(destination_sitename);
SPWeb destWeb = destSite.OpenWeb();
foreach (SPUser user in spusers)
{

destWeb.AllowUnsafeUpdates = true;
SPGroup destGroup = null;
try
{
destGroup = destWeb.SiteGroups[destination_groupname];
int countD = destGroup.Users.Count;
destGroup.AddUser(user);

destGroup.Update();

}
catch
{
Console.WriteLine("\n\n");
Console.WriteLine("Error: Group doesn't exist at destination URL");


}
SPUserCollection spdest_users = destWeb.SiteGroups[destination_groupname].Users;

if (spdest_users.Count >= spusers.Count)
{
flag = true;

}

else
{
flag = false;
}


}
destWeb.Close();
destSite.Close();

}
else
{
Console.WriteLine("\n\n");
Console.WriteLine("Error");
}


}
catch (Exception)
{
Console.WriteLine("Error: Verify Details.");
}

spWeb.Close();
spSite.Close();


}
}
});
return flag;


}
catch
{
Console.WriteLine("\n\n");
Console.WriteLine("Error: Check Original Url and Destination Url.");

return false;
}



}

 
Didn't find what you were looking for? Find more on Moving users from one sharepoint group to another Or get search suggestion and latest updates.




Tagged: