I've written a spot of code to delete a massive number of unwanted members. It basically looks like this
using umbraco.cms.businesslogic.member;
using umbraco.cms.businesslogic.propertytype;
ArrayList arrNodes = new ArrayList();
//populate arrNodes with list of nodeids - there is code for this but I won't put it here
foreach (int i in arrNodes)
{
MemberType siteUserType = new MemberType(1042);
Member myMember = new Member(i);
myMember.delete();
}
It seems to be working fine, but I thought I'd ask is there anything else I need to be doing. my members do have custom properties and I was worried that I may not be removing them correctly using this method.
If I'm doing something dumb, can anyone let me know?
deleting members via api
Hi all
I've written a spot of code to delete a massive number of unwanted members. It basically looks like this
It seems to be working fine, but I thought I'd ask is there anything else I need to be doing. my members do have custom properties and I was worried that I may not be removing them correctly using this method.
If I'm doing something dumb, can anyone let me know?
Many thanks
Shaun
HI Shaun,
Deleting members using Member.Delete() will just work it will delete all references also.
Cheers,
Richard
Thanks Richard!
is working on a reply...