다음을 통해 공유


SiteData.GetSite Method

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.

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

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetSite", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetSite ( _
    <OutAttribute> ByRef sSiteMetadata As _sSiteMetadata, _
    <OutAttribute> ByRef vWebs As _sWebWithTime(), _
    <OutAttribute> ByRef strUsers As String, _
    <OutAttribute> ByRef strGroups As String, _
    <OutAttribute> ByRef vGroups As String() _
) As UInteger
'Usage
Dim instance As SiteData
Dim sSiteMetadata As _sSiteMetadata
Dim vWebs As _sWebWithTime()
Dim strUsers As String
Dim strGroups As String
Dim vGroups As String()
Dim returnValue As UInteger

returnValue = instance.GetSite(sSiteMetadata, _
    vWebs, strUsers, strGroups, vGroups)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetSite", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    ResponseNamespace = "https://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

  • vWebs
    Type: []

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

  • strUsers
    Type: System.String

    This parameter is not used but must be passed.

  • strGroups
    Type: System.String

    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
    Type: []

    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

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

Examples

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.

Dim srvSiteData As New Web_Reference_Name.SiteData()
srvSiteData.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim siteMData As Web_Reference_Name._sSiteMetadata
Dim siteTime() As Web_Reference_Name._sWebWithTime

Dim users As String
Dim groups As String
Dim arrGroups() As String

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

label1.Text = siteMData.PortalUrl + ControlChars.Lf

Dim time As Web_Reference_Name._sWebWithTime

For Each time In  siteTime

    label1.Text += time.Url + " :: " + time.LastModified.ToString() + ControlChars.Lf

Next time

label1.Text += groups + ControlChars.Lf

Dim str As String

For Each str In  arrGroups

    label1.Text += str + ControlChars.Lf

Next str
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";
}

See Also

Reference

SiteData Class

SiteData Members

SiteData Web Service