Skip to content

aSiteCollectionGroups statement

The aSiteCollectionGroups statement returns information about the collection of groups for the specified site collections.

<aSiteCollectionGroups tableName="">
<from type=""></from>
<fields></fields>
<where></where>
</aSiteCollectionGroups>

Specify one or more web sites from which to retrieve the group collection. The type attribute will indicate how site urls are specified.

Type Description
Url Specify one or more relative site url separated by a comma. A report’s parameter may be specified instead of a literal value.
ResultSet Specify the tableName value of another statement. The resulting data from the statement must contain a column named “relativeSiteUrl”.

The following statement will return all the groups located in sites “/sites/demo/” and “/sites/ersdetest”.

Sample

<aSiteCollectionGroups tableName="SiteCollectionGroups">
<from type="Url">/sites/demo/,/sites/ersdetest/</from>
<fields>*</fields>
<where></where>
</aSiteCollectionGroups>

In the following example, the query will return information about the collection of groups for the sites specified in another result set called “MergingList”. The “MergingList” result set contains data returned by a list statement that queries the “Merging List” SharePoint list.

The SharePoint list “Merging list” must contain a column called “RelativeSiteUrl” that contains relative urls that point to SharePoint sites.

The aSiteCollectionGroups statement will retrieve the collection of groups for each item in the “MergingList” result set based on the “RelativeSiteUrl” column’s value.

Sample

<root xmlns="http://enesyssoftware.com/schemas">
<list title="Merging list" relativeSiteUrl="/sites/demo/" tableName="Merginglist">
<fields>relativeSiteUrl</fields>
<query></query>
</list>
<aSiteCollectionGroups tableName="aSiteCollectionGroups">
<from type="ResultSet">Merginglist</from>
<fields></fields>
<where></where>
</aSiteCollectionGroups>
<resultSet>aSiteCollectionGroups</resultSet>
</root>

You must be aware that the groups are retrieved for a specific site collection, so querying groups using two sites from the same site collection will return duplicated results.

Specify the fields to be returned by the statement.

Field Description
ID The identifier (ID) for the group.  
Name The name of the group.  
Description The description for the group.  
OwnerID The identifier (ID) for the owner of the group, which can be a user or another group.  
OwnerIsUser Boolean variable that specifies whether the owner is a user.

SQL Where clause used to filter the resulting data.

The following query returns information about groups (created in “/sites/ersdedemo” site) which owners are groups:

Sample

<root xmlns="http://enesyssoftware.com/schemas">
<aSiteCollectionGroups tableName="aSiteCollectionGroups1">
<from type="Url">/sites/ersdedemo/</from>
<fields></fields>
<where>NOT OwnerIsUser</where>
</aSiteCollectionGroups>
<resultSet>aSiteCollectionGroups1</resultSet>
</root>