I was wondering if it's possible to alter a setting of a group such as Who can view the membership of the group?

Setting from Group Members to Everyone through CSOM or through SP's web services.

Right now I am creating a group using the AddGroup web service, but I can't seem to find any documentation on altering this setting. Any ideas?

for group creation I have followed below code

<script type="text/javascript">
    var siteUrl = '';
    function createListItem() {
    var getvalue = document.getElementById('<%=txtcategory.ClientID%>').value;
    var membersGRP = new SP.GroupCreationInformation();
    membersGRP.set_title(getvalue + '_Support_Group');
    oMembersGRP = currentWEB.get_siteGroups().add(membersGRP);
    oMembersGRP = currentWEB.get_siteGroups().add   
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
  • It seems that part of your code is missing. Oct 6, 2015 at 7:39
  • @Chakri : Your code looks incomplete. Also the way you have explained your question is not clear. I suggest you to rephrase it, in order to get more attention.
    – Asad Refai
    Oct 6, 2015 at 8:53

1 Answer 1


You can change membership visibility via CSOM using set_onlyAllowMembersViewMembership function:

var context = SP.ClientContext.get_current()
var web = context.get_web()
var groups = web.get_siteGroups()
var info = new SP.GroupCreationInformation()
var group = groups.add(info)
group.set_onlyAllowMembersViewMembership(false) //this line sets membership visibility
context.executeQueryAsync(successHandler, errorHandler)
  • Thank u dstarkowski,its working fine
    – chakri
    Oct 6, 2015 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.