none
Does SharePoint add the same user again & again in SharePoint group programmatically ?

    Question

  • Hi All,

    I have a console which is adding the current user to SharePoint group programmatically(csom).

    So if I run the console again and again with user details, will the console add the same user again and again in same SharePoint group ?

     Lets say : I run the console 10 times with same user, would I see 10 entries for same user in the SharePoint group ?

    Or would there only 1 entry per user in SharePoint group ??? 


    Thanks in Advance, Jiniv Thakkar

    Wednesday, January 18, 2017 12:55 PM

Answers

  • Yes, I don't think it matters whether you check for an existing user.  It would be the way I would write it, but if you have verified that it doesn't create duplicates then it doesn't really matter.

    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

    • Marked as answer by Jiniv Thakkar Friday, January 27, 2017 5:47 AM
    Wednesday, January 18, 2017 1:17 PM

All replies

  • You should end up with only one entry, but without access to your code its hard to be 100% sure.  This is the kind of thing that you could easily verify in a lab.  Just run it in a dev environment 10 times and go look at the results.

    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

    Wednesday, January 18, 2017 1:07 PM
  • I already did verify but I wanted some kind of confirmation from MVP,so ensure user can only be done once right ?

    And its ok if I dont check if user is already present or not, as it hardly matters ??


    Thanks in Advance, Jiniv Thakkar

    Wednesday, January 18, 2017 1:11 PM
  • Yes, I don't think it matters whether you check for an existing user.  It would be the way I would write it, but if you have verified that it doesn't create duplicates then it doesn't really matter.

    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

    • Marked as answer by Jiniv Thakkar Friday, January 27, 2017 5:47 AM
    Wednesday, January 18, 2017 1:17 PM