UserGroup.RemoveGroup Method

Removes the specified group from the current site collection.

Web Service: Users and GroupsWeb Reference: http://<Site>/_vti_bin/usergroup.asmx

Syntax

<SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/directory/RemoveGroup", RequestNamespace:="http://schemas.microsoft.com/sharepoint/soap/directory/", ResponseNamespace:="http://schemas.microsoft.com/sharepoint/soap/directory/", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
Public Sub RemoveGroup ( _
    groupName As String _
)

Dim instance As UserGroup
Dim groupName As String

instance.RemoveGroup(groupName)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/directory/RemoveGroup", RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/directory/", ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/directory/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public void RemoveGroup (
    string groupName
)

Parameters

  • groupName
    A string that contains the name of the group.

Example

The following code example removes the specified group from the current site collection.

Dim usrgrpService As New Web_Reference_Folder_Name.UserGroup()
usrgrpService.Credentials = System.Net.CredentialCache.DefaultCredentials

usrgrpService.RemoveGroup("Group_Name")
Web_Reference_Folder_Name.UserGroup usrgrpService = new Web_Reference_Folder_Name.UserGroup();
usrgrpService.Credentials= System.Net.CredentialCache.DefaultCredentials;

usrgrpService.RemoveGroup("Group_Name");

See Also

Reference

UserGroup Class
UserGroup Members
Users and Groups Web Service