Share via


UserGroup.GetRoleCollectionFromGroup Method

Returns information about the collection of role definitions of which the specified group is a member.

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

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/directory/GetRoleCollectionFromGroup", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/directory/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/directory/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetRoleCollectionFromGroup ( _
    groupName As String _
) As XmlNode
'Usage
Dim instance As UserGroup
Dim groupName As String
Dim returnValue As XmlNode

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

Parameters

  • groupName
    Type: System.String

    A string that contains the name of the group.

Return Value

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

<GetRoleCollectionFromGroup xmlns=
   "https://schemas.microsoft.com/sharepoint/soap/directory/">
   <Roles>
      <Role ID="1073741830" Name="Site_Group1" 
         Description="Description" Type="0" />
      <Role ID="1073741833" Name="Site_Group2" 
         Description="Description" Type="0" />
      .
      .
      .
</Roles></GetRoleCollectionFromGroup>

Examples

The following code example displays the collection of role definitions of which the group is a member. 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 ndSiteGroups As XmlNode = usrgrpService.GetRoleCollectionFromGroup("Group_Name")

MessageBox.Show(ndSiteGroups.OuterXml)
Web_Reference_Folder_Name.UserGroup usrgrpService = new Web_Reference_Folder_Name.UserGroup();
usrgrpService.Credentials= System.Net.CredentialCache.DefaultCredentials;

XmlNode ndSiteGroups = usrgrpService.GetRoleCollectionFromGroup("Group_Name");

MessageBox.Show(ndSiteGroups.OuterXml);

See Also

Reference

UserGroup Class

UserGroup Members

UserGroup Web Service