UserGroup.GetGroupCollection Method

Returns information about the specified groups in the current site collection.

Namespace:  [UserGroup Web service]
Web service reference: http://Site/_vti_bin/UserGroup.asmx


<SoapDocumentMethodAttribute("", RequestNamespace := "",  _
    ResponseNamespace := "",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetGroupCollection ( _
    groupNamesXml As XmlNode _
) As XmlNode
Dim instance As UserGroup
Dim groupNamesXml As XmlNode
Dim returnValue As XmlNode

returnValue = instance.GetGroupCollection(groupNamesXml)
[SoapDocumentMethodAttribute("", RequestNamespace = "", 
    ResponseNamespace = "", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetGroupCollection(
    XmlNode groupNamesXml


  • groupNamesXml
    Type: System.Xml.XmlNode

    A System.Xml.XmlNode object that specifies one or more group names in the following form:

       <Group GroupName="Group1"/>
       <Group GroupName="Group2"/>

Return Value

Type: System.Xml.XmlNode
An XML fragment in the following form that can be assigned to a System.Xml.XmlNode object.

<GetGroupCollection xmlns=
      <Group ID="3" Name="Group1" Description="Description" OwnerID="1" 
         OwnerIsUser="False" />
      <Group ID="15" Name="Group2" Description="Description" 
         OwnerID="12" OwnerIsUser="True" />


The following code example displays information about specified groups on a Web site. The example assumes the existence of a local XML file that contains the names of the groups, which are loaded into a System.Xml.XmlDocument object. This example requires that a using (Visual C#) or Imports (Visual Basic) directive be included for the System.Xml namespace.

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

Dim myDocument As New XmlDocument()

Dim ndGroupNames As XmlNode = myDocument.DocumentElement

Dim ndGroups As System.Xml.XmlNode = usrgrpService.GetGroupCollection(ndGroupNames)

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

XmlDocument myDocument = new XmlDocument();

XmlNode ndGroupNames = myDocument.DocumentElement;

System.Xml.XmlNode ndGroups = usrgrpService.GetGroupCollection(ndGroupNames);


See Also


UserGroup Class

UserGroup Members

UserGroup Web Service