This topic has not yet been rated - Rate this topic

SiteData.GetSite Method

Windows SharePoint Services 3
Returns site metadata, information about the subsites in the current site collection, and information about the cross-site groups on the site and about the users who are members of each group.

Web Service: Site DataWeb Reference: http://<Site>/_vti_bin/SiteData.asmx
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/GetSite", RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public uint GetSite (
	out _sSiteMetadata sSiteMetadata,
	out _sWebWithTime[] vWebs,
	out string strUsers,
	out string strGroups,
	out string[] vGroups
)

Parameters

sSiteMetadata

Site metadata from the current site.

vWebs

An array containing information about the sites in the current site collection, including their URLs and the dates they were last modified.

strUsers

This parameter is not used but must be passed.

strGroups

Information about the cross-site groups on the current site in the following form:

<Groups>
  <Group ID="4" Name="Group1" 
     Description="Description" 
     OwnerID="1" OwnerIsUser=
     "True" />
  <Group ID="4" Name="Group2" 
     Description="Description" 
    OwnerID="1" OwnerIsUser=
    "True" />
</Groups>
vGroups

Information about the users in each cross-site group on the site in the following form:

<Users>
  <User ID="1" Sid="S-1-5-21-
     2127521184-1604012920-
     1887927527-76687" 
     Name="Display_Name" 
     LoginName="DOMAIN\User_Alias" 
     Email="Email_Address" Notes="" 
     IsSiteAdmin="True" 
     IsDomainGroup="False" />
  <User ID="1" Sid="S-1-5-21-
     2127521184-1604012920-
     1887927527-259353" 
     Name="Display_Name" 
     LoginName="DOMAIN\User_Alias" 
     Email="Email_Address" Notes="" 
     IsSiteAdmin="True" 
     IsDomainGroup="False" />
</Users>

Return Value

A 32-bit unsigned integer that returns 0 to indicate that the operation has completed.

The following code example displays information about the cross-site groups on the current site and the users who are members of each group. This example assumes the existence of a label within the form of a Windows Application.

Web_Reference_Name.SiteData srvSiteData = new Web_Reference_Name.SiteData();
srvSiteData.Credentials = System.Net.CredentialCache.DefaultCredentials;

Web_Reference_Name._sSiteMetadata siteMData;
Web_Reference_Name._sWebWithTime[] siteTime;

string users;
string groups;
string[] arrGroups; 

srvSiteData.GetSite(out siteMData, out siteTime, out users, out groups, out arrGroups);

label1.Text = siteMData.PortalUrl + "\n";

foreach (Web_Reference_Name._sWebWithTime time in siteTime)
{
    label1.Text += time.Url + " :: " + time.LastModified.ToString() + "\n";
}

label1.Text += groups + "\n";

foreach (string str in arrGroups)
{
    label1.Text += str + "\n";
}
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.