Table of Contents

Interface ISharePointAdmin

Namespace
PnP.Core.Admin.Model.SharePoint
Assembly
PnP.Core.Admin.dll

SharePoint Admin features

public interface ISharePointAdmin

Methods

ConnectToHubSite(Uri, Uri, VanityUrlOptions)

Connects a site collection to a hub site. This method can also connect the site collection when the hub site requires approval for connecting new sites.

void ConnectToHubSite(Uri siteCollectionUrlToConnect, Uri hubSiteCollectionUrl, VanityUrlOptions vanityUrlOptions = null)

Parameters

siteCollectionUrlToConnect Uri

Uri of the site collection to connect to the hub

hubSiteCollectionUrl Uri

Uri of the hub to connect the site collection to

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

ConnectToHubSiteAsync(Uri, Uri, VanityUrlOptions)

Connects a site collection to a hub site. This method can also connect the site collection when the hub site requires approval for connecting new sites.

Task ConnectToHubSiteAsync(Uri siteCollectionUrlToConnect, Uri hubSiteCollectionUrl, VanityUrlOptions vanityUrlOptions = null)

Parameters

siteCollectionUrlToConnect Uri

Uri of the site collection to connect to the hub

hubSiteCollectionUrl Uri

Uri of the hub to connect the site collection to

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task

GetTenantAdminCenterContext(VanityUrlOptions)

Returns a PnPContext for the tenant's SharePoint admin center site

PnPContext GetTenantAdminCenterContext(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

PnPContext

PnPContext for the tenant's SharePoint admin center

GetTenantAdminCenterContextAsync(VanityUrlOptions)

Returns a PnPContext for the tenant's SharePoint admin center site

Task<PnPContext> GetTenantAdminCenterContextAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<PnPContext>

PnPContext for the tenant's SharePoint admin center

GetTenantAdminCenterUri(VanityUrlOptions)

Returns the SharePoint tenant admin center url (e.g. https://contoso-admin.sharepoint.com)

Uri GetTenantAdminCenterUri(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Uri

SharePoint tenant admin center url

GetTenantAdminCenterUriAsync(VanityUrlOptions)

Returns the SharePoint tenant admin center url (e.g. https://contoso-admin.sharepoint.com)

Task<Uri> GetTenantAdminCenterUriAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<Uri>

SharePoint tenant admin center url

GetTenantAdmins(VanityUrlOptions)

Returns a list of ISharePointUsers who are SharePoint Online Tenant admin

List<ISharePointUser> GetTenantAdmins(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

List<ISharePointUser>

List of SharePoint Online Tenant admins

GetTenantAdminsAsync(VanityUrlOptions)

Returns a list of ISharePointUsers who are SharePoint Online Tenant admin

Task<List<ISharePointUser>> GetTenantAdminsAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<List<ISharePointUser>>

List of SharePoint Online Tenant admins

GetTenantMySiteHostUri(VanityUrlOptions)

Returns the SharePoint tenant my site host url (e.g. https://contoso-my.sharepoint.com)

Uri GetTenantMySiteHostUri(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Uri

SharePoint tenant my site host url

GetTenantMySiteHostUriAsync(VanityUrlOptions)

Returns the SharePoint tenant my site host url (e.g. https://contoso-my.sharepoint.com)

Task<Uri> GetTenantMySiteHostUriAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<Uri>

SharePoint tenant my site host url

GetTenantPortalUri(VanityUrlOptions)

Returns the SharePoint tenant portal url (e.g. https://contoso.sharepoint.com)

Uri GetTenantPortalUri(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Uri

SharePoint tenant portal url

GetTenantPortalUriAsync(VanityUrlOptions)

Returns the SharePoint tenant portal url (e.g. https://contoso.sharepoint.com)

Task<Uri> GetTenantPortalUriAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<Uri>

SharePoint tenant portal url

GetTenantProperties(VanityUrlOptions)

Gets the properties of this tenant

ITenantProperties GetTenantProperties(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

ITenantProperties

Properties of the tenant

GetTenantPropertiesAsync(VanityUrlOptions)

Gets the properties of this tenant

Task<ITenantProperties> GetTenantPropertiesAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<ITenantProperties>

Properties of the tenant

GetTenantSearchConfigurationManagedProperties(VanityUrlOptions)

Gets the managed properties from the search configuration of the tenant

List<IManagedProperty> GetTenantSearchConfigurationManagedProperties(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

List<IManagedProperty>

List of managed properties

GetTenantSearchConfigurationManagedPropertiesAsync(VanityUrlOptions)

Gets the managed properties from the search configuration of the tenant

Task<List<IManagedProperty>> GetTenantSearchConfigurationManagedPropertiesAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<List<IManagedProperty>>

List of managed properties

GetTenantSearchConfigurationXml(VanityUrlOptions)

Gets the search configuration of the tenant

string GetTenantSearchConfigurationXml(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

string

Search configuration XML

GetTenantSearchConfigurationXmlAsync(VanityUrlOptions)

Gets the search configuration of the tenant

Task<string> GetTenantSearchConfigurationXmlAsync(VanityUrlOptions vanityUrlOptions = null)

Parameters

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task<string>

Search configuration XML

IsCurrentUserTenantAdmin()

Checks if the current user is SharePoint Online tenant admin

bool IsCurrentUserTenantAdmin()

Returns

bool

True if the user is a SharePoint Online tenant admin, false otherwise

IsCurrentUserTenantAdminAsync()

Checks if the current user is SharePoint Online tenant admin

Task<bool> IsCurrentUserTenantAdminAsync()

Returns

Task<bool>

True if the user is a SharePoint Online tenant admin, false otherwise

SetTenantSearchConfigurationXml(string, VanityUrlOptions)

Sets the search configuration for the tenant

void SetTenantSearchConfigurationXml(string configuration, VanityUrlOptions vanityUrlOptions = null)

Parameters

configuration string

Search configuration, obtained via GetTenantSearchConfigurationXml(VanityUrlOptions) to apply

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

SetTenantSearchConfigurationXmlAsync(string, VanityUrlOptions)

Sets the search configuration for the tenant

Task SetTenantSearchConfigurationXmlAsync(string configuration, VanityUrlOptions vanityUrlOptions = null)

Parameters

configuration string

Search configuration, obtained via GetTenantSearchConfigurationXml(VanityUrlOptions) to apply

vanityUrlOptions VanityUrlOptions

Optionally specify the custom vanity URI's used by this tenant

Returns

Task