Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Shaun 248 posts 475 karma points
    Jun 17, 2010 @ 10:39
    Shaun
    0

    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

     

    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?

    Many thanks

    Shaun

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Jun 17, 2010 @ 11:01
    Richard Soeteman
    1

    HI Shaun,

    Deleting members using Member.Delete() will just work it will delete all references also.

    Cheers,

    Richard

  • Shaun 248 posts 475 karma points
    Jun 17, 2010 @ 12:45
    Shaun
    0

    Thanks Richard!

Please Sign in or register to post replies

Write your reply to:

Draft