I have a large number of members in test system - nearing time to lauch and want to delete them. I would have though that the blow would suffice - but the whole system seems to just hang with no action taken:
Would'nt you be able to delete the users directly from the database? Must admit that I'm not sure how many tables you need to look at but just a thought...
I probably could - and I have a list of 6 tables I belive are involved / affected. But I'm a bit nervous about doing this in case it upsets things somehow, and I'm also curious to know why the simple code based approach above won't work.
(I actually found a sql script in the old forums to do this - but it was aimed at version 3 when I'm on 4.5.)
I may do a back of db, and try it out the sql way if I get no responses on my original approach. Thanks for your input, much appreciated.
The Member.GetAlll method slows you down. What you could do is use the MemberExport package (in batches of 200 records if you want to use the free version) which exports the MemberIds. Load this file and then use the API call New Member(memberid).Delete(); to delete the members
Thanks Masood / Richard as this was the way to go. I did look at the MemberExport package but it seemed no point using due to such a simple query doing the exact same thing.
Bulk Delete Members
I have a large number of members in test system - nearing time to lauch and want to delete them. I would have though that the blow would suffice - but the whole system seems to just hang with no action taken:
IEnumerable<umbraco.cms.businesslogic.member.Member> allMembers = umbraco.cms.businesslogic.member.Member.GetAllAsList();
foreach (umbraco.cms.businesslogic.member.Member m in allMembers)
{
Membership.DeleteUser(mu.UserName);
SATUtilities.LogInfo("Deleted!");
}
Also, using the .Net Membership API Membership.GetAllUsers() is returning nothing (empty collection) when I try to do the delete using thsi api.
Is there a preferred way to go about a task such as this?
Cheers,
Andles
Hi Andles
Would'nt you be able to delete the users directly from the database? Must admit that I'm not sure how many tables you need to look at but just a thought...
/Jan
I probably could - and I have a list of 6 tables I belive are involved / affected. But I'm a bit nervous about doing this in case it upsets things somehow, and I'm also curious to know why the simple code based approach above won't work.
(I actually found a sql script in the old forums to do this - but it was aimed at version 3 when I'm on 4.5.)
I may do a back of db, and try it out the sql way if I get no responses on my original approach. Thanks for your input, much appreciated.
Cheers,
Andles.
HI Andies,
The Member.GetAlll method slows you down. What you could do is use the MemberExport package (in batches of 200 records if you want to use the free version) which exports the MemberIds. Load this file and then use the API call New Member(memberid).Delete(); to delete the members
Hope this helps you,
Richard
You can get memberIds using following sql query and then use new Member(memberid).Delete() method (as noted by Richard):
Thanks Masood / Richard as this was the way to go. I did look at the MemberExport package but it seemed no point using due to such a simple query doing the exact same thing.
A better Member Manaegement too (and completely free) is : http://our.umbraco.org/projects/backoffice-extensions/blackpoint-member-admin
Wish I'd have found that sooner!
Not sure if it does export - but this is pretty much a straightforward sql query anyway.
is working on a reply...