SharePoint - Search site(s)
Declaration
<AMSHAREPOINT ACTIVITY="search_sites" SESSION="text" SITE="text" VERSION="text (options)" SPOAUTHTYPE="text (options)" AUTHTYPE="text (options)" USERNAME="text" PASSWORD="text" DOMAIN="text" CLIENTID="text" CLIENTSECRET="text" AADTENANTID="text (encrypted)" AADCLIENTID="text (encrypted)" AADCERTIFICATE="text" AADCERTIFICATEPASSWORD="text (encrypted)" AZUREENVIRONMENT="text (options)" CERTIFICATE="text" IGNOREINVALIDCERTIFICATE="YES/NO" TIMEOUT="500" PROXYTYPE="text (options)" PROXYSERVER="text" PROXYUSERNAME="text" PROXYPASSWORD="text (options)" QUERY="text" ROWLIMIT="number" TRIM="YES/NO" RESULTDATASET="text" />
Description
Retrieves available sites/sub-sites from a SharePoint server and creates and populates a dataset with the results.
Practical usage
Use to get information regarding SharePoint sites and sub-sites. This activity supports building search queries using:
- Keyword Query Language (KQL) - KQL is the default query language for building search queries. Using KQL, you specify the search terms or property restrictions that are passed to the SharePoint search service.
- FAST Query Language (FQL) - FQL is a structured query language that supports advanced query operators. You can use FQL when you want to create complex queries that you want to pass programmatically to the SharePoint search service.
Parameters
Connection
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Connection | --- | --- | --- | --- | Indicates
where this activity's SharePoint credentials should originate
from. The available options
are:
NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes. |
Connection - Session
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Session | Text | Yes, if Connection is set to Session | SharePointSession1 | SESSION="mySession1" | The
name of the session to associate with this activity. This parameter
is only active if the Connection
parameter is set to Session . If Connection
is set to Host,
this parameter is ignored and the remainder of the parameters
specified below become active. NOTE: Use the SharePoint - End session
activity to end an active SharePoint session. |
Connection - Host > Server
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Version | Text (options) | Yes, if Connection is set to Host | SharePoint 2013 and newer |
VERSION="sharepointonline" |
The
SharePoint version to associate with this activity. The available options are:
|
Site | Text | Yes, if Connection is set to Host | (Empty) | SITE="http://myServer/tech" | The SharePoint site to access. A SharePoint site is a collection of pages, site templates, lists, and libraries configured for the purpose of achieving an express goal. |
Refer to these parameters when Version is set to SharePoint Online. | |||||
Authentication type | Type (options) | Yes | Default |
|
Specifies the authentication type to use with the connection. The available options are:
|
Username | Text | Yes, if Authentication type is set to Default | (Empty) | USERNAME="theUserName" | The username to use for authenticating to the SharePoint site. This parameter is only required if the Authentication type parameter is set to Default. |
Password | Text | Yes, if Authentication type is set to Default | (Empty) | PASSWORD="text (encrypted)" | The password to use to authenticate with the Username parameter. This parameter is required if the Authentication type parameter is set to Default. |
Client ID | Text | Yes, if Authentication type is set to SharePoint App Only | (Empty) | CLIENTID="text (encrypted)" | The Client ID in SharePoint to use for authentication. This parameter is encrypted in Task Builder. This parameter is required when the Authentication type parameter is set to SharePoint App Only. |
Client secret | Text | Yes, if Authentication type is set to SharePoint App Only | (Empty) | CLIENTSECRET="text (encrypted)" | The Client Secret in SharePoint to use for authentication. This parameter is required if the Authentication type parameter is set to SharePoint App Only. |
Azure Tenant ID | Text | Yes, if Authentication type is set to Azure AD App Only or Azure AD Delegated | (Empty) | AADTENANTID="text (encrypted)" | The Directory (tenant) ID in Azure AD to use for authentication. This parameter is required if the Authentication type parameter is set to Azure AD App Only or Azure AD Delegated. |
Azure Client ID | Text | Yes, if Authentication type is set to Azure AD App Only or Azure AD Delegated | (Empty) | AADCLIENTID="text (encrypted)" | The Application (client) ID in Azure AD to use for authentication. This parameter is required if the Authentication type parameter is set to Azure AD App Only or Azure AD Delegated. |
Azure AD certificate | Text | Yes, if Authentication type is set to Azure AD App Only | (Empty) | AADCERTIFICATE="certificate.pfx" | The Azure AD certificate file (.pfx) to use for authentication. This parameter is required if the Authentication type parameter is set to Azure AD App Only. |
Azure AD certificate password | Text | No | (Empty) | AADCERTIFICATEPASSWORD="text (encrypted)" | The password to use to authenticate with the Azure AD Certificate parameter. This parameter is becomes available when Authentication type is set to Azure AD App Only. |
Azure Environment | Text (options) | Yes, if Authentication type is set to SharePoint App Only, Azure AD App Only, or Azure AD Delegated | Azure |
|
The Azure environment to use for authentication. The available options are:
This parameter is required if the Authentication type parameter is set to SharePoint App Only, Azure AD App Only, or Azure AD Delegated. |
Refer to these parameters when Version is set to SharePoint 2013 and newer. | |||||
Authentication type | Text (options) | Yes | System default |
|
Specifies the authentication type to use with the connection. Associated parameters vary with each type. The available options are:
|
Username | Text | Yes, if Authentication type is set to Basic or Form | (Empty) | USERNAME="theUserName" | The username to use for authenticating to the SharePoint site. This parameter is only required if Authentication type is set to Basic or Form. |
Password | Text | Yes, if Authentication type is set to Basic or Form | (Empty) | PASSWORD="text (encrypted)" | The password to use to authenticate with the Username parameter. This parameter is only required if Authentication type is set to Basic or Form. |
Domain | Text | Yes, if Authentication type is set to Basic or Form | (Empty) | DOMAIN="myServer" | The domain the user belongs to. This parameter is only required if Authentication type is set to Basic or Form. |
These parameters are available when Version is set to SharePoint Online or SharePoint 2013 and newer. | |||||
Certificate | Text | No | (Empty) | CERTIFICATE="C:\Temp\file.cer" | The (DER encoded) certificate to use for SharePoint authentication. |
Ignore invalid certificate | Yes/No | No | No | IGNOREINVALIDCERTIFICATE="yes" | If selected, invalid server certificates are automatically ignored. This parameter is disabled by default. |
Timeout (seconds) | Number | No | 600 | TIMEOUT="500" | The number of seconds to wait to connect to the SharePoint server before a timeout error is generated. The default value is 600 seconds. |
Connection - Host > Proxy
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Proxy type | Text (options) | Yes | Default |
|
The
type of proxy required for SharePoint connections that pass through
a proxy server. The available options are:
|
Use authentication | --- | No | --- | --- | If
enabled, specifies proxy authentication is required,
enabling authentication-based parameters (disabled by default).
It is active only if Proxy
type is set to HTTP. NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes. |
Proxy server | Text | No | (Empty) | PROXYSERVER="proxy.host.com" | The hostname (server.domain.com) or IP address (xxx.xxx.xxx.xxx) of the proxy server. This parameter is available only if Proxy type is set to HTTP. |
Proxy username | Text | No | (Empty) | PROXYUSERNAME="username" | The proxy username to authenticate with. This parameter is available only if Use authentication is enabled. |
Proxy port | Number | No | 808 | PROXYPORT="8080" | The port number to use to connect to the proxy server. This parameter is available only if Proxy type is set to HTTP. The default value is 808. |
Proxy password | Text | No | (Empty) | PROXYPASSWORD="encrypted" | The proxy password to authenticate with. This parameter is available only if Use authentication is enabled. |
Site
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Query | Text | Yes | (Empty) | QUERY="text" | The
query to use for the search. This activity supports building search queries
using:
See Building search queries in SharePoint for more information on search queries. |
Create and populate dataset with SharePoint search result(s) information | Text | Yes | (Empty) | RESULTDATASET="dataset_name" | The name of the dataset to create and populate with information regarding the sites that are retrieved. For more information, see Datasets |
Row limit | Number | Yes | 50 | ROWLIMIT="100" | Sets the row limit for the number of items to display in a view. |
Trim duplicates | Yes/No | No | Yes | TRIM="NO" | Specifies whether duplicate items should be removed from the search results. If selected (default), duplicates will be removed. If disabled, duplicates will remain in the search results. |
Additional notes
Datasets
A dataset is a multiple column, multiple row container object where every column represents a particular variable, and each row corresponds to a given member of the dataset in question. This activity creates and populates a dataset containing specific fields (rows) in addition to the standard dataset fields. The table below describes these fields (assuming the dataset name assigned was theDataset).
Name | Type | Return Value |
---|---|---|
theDataset.Author | Text | The author of the document. |
theDataset.IsDocument | Boolean | Yes if the item is a document. No if not. |
theDataset.Path | Text | The path to the site (for example, /sites/can/fs). |
theDataset.SiteName | Text | The name of the site. |
theDataset.Title | Text | The title of the SharePoint site. |
theDataset.Write | Text | A 32-bit integer that specifies the Write security setting. |
Example
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
This sample task performs a search on a SharePoint site.
<AMSHAREPOINT ACTIVITY="search_sites" SESSION="SharePointSession1" QUERY="<insert query here>" RESULTDATASET="dataset_name" />