Interface ISiteCollectionManager
SharePoint Site Collection features
Namespace: PnP.Core.Admin.Model.SharePoint
Assembly: PnP.Core.Admin.dll
Syntax
public interface ISiteCollectionManager
Methods
ConnectSiteCollectionToGroup(ConnectSiteToGroupOptions, CreationOptions)
Connects an existing site collection to a new Microsoft 365 group
Declaration
void ConnectSiteCollectionToGroup(ConnectSiteToGroupOptions siteGroupConnectOptions, CreationOptions creationOptions = null)
Parameters
ConnectSiteToGroupOptions
siteGroupConnectOptions
Information needed to handle the connection of the site collection to a new Microsoft 365 group. |
CreationOptions
creationOptions
Options to control the connect to site process |
ConnectSiteCollectionToGroupAsync(ConnectSiteToGroupOptions, CreationOptions)
Connects an existing site collection to a new Microsoft 365 group
Declaration
Task ConnectSiteCollectionToGroupAsync(ConnectSiteToGroupOptions siteGroupConnectOptions, CreationOptions creationOptions = null)
Parameters
ConnectSiteToGroupOptions
siteGroupConnectOptions
Information needed to handle the connection of the site collection to a new Microsoft 365 group. |
CreationOptions
creationOptions
Options to control the connect to site process |
Returns
Task
|
CreateSiteCollection(CommonSiteOptions, SiteCreationOptions, VanityUrlOptions)
Creates a site collection and returns a PnPContext to start using the created site collection
Declaration
PnPContext CreateSiteCollection(CommonSiteOptions siteToCreate, SiteCreationOptions creationOptions = null, VanityUrlOptions vanityUrlOptions = null)
Parameters
CommonSiteOptions
siteToCreate
Information about the site collection to create. Pass in a CommunicationSiteOptions, TeamSiteOptions, TeamSiteWithoutGroupOptions or ClassicSiteOptions instance. |
SiteCreationOptions
creationOptions
Options that control the site creation process |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
PnPContext
A PnPContext to start using the created site collection |
CreateSiteCollectionAsync(CommonSiteOptions, SiteCreationOptions, VanityUrlOptions)
Creates a site collection and returns a PnPContext to start using the created site collection
Declaration
Task<PnPContext> CreateSiteCollectionAsync(CommonSiteOptions siteToCreate, SiteCreationOptions creationOptions = null, VanityUrlOptions vanityUrlOptions = null)
Parameters
CommonSiteOptions
siteToCreate
Information about the site collection to create. Pass in a CommunicationSiteOptions, TeamSiteOptions, TeamSiteWithoutGroupOptions or ClassicSiteOptions instance. |
SiteCreationOptions
creationOptions
Options that control the site creation process |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task<PnPContext>
A PnPContext to start using the created site collection |
DeleteRecycledSiteCollection(Uri, VanityUrlOptions)
Deletes a site collection from the recycle bin.
Declaration
void DeleteRecycledSiteCollection(Uri siteToDelete, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
siteToDelete
Site collection to delete from the recycle bin |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
DeleteRecycledSiteCollectionAsync(Uri, VanityUrlOptions)
Deletes a site collection from the recycle bin.
Declaration
Task DeleteRecycledSiteCollectionAsync(Uri siteToDelete, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
siteToDelete
Site collection to delete from the recycle bin |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task
|
DeleteSiteCollection(Uri, VanityUrlOptions)
Deletes a site collection. The deleted site collection is also removed from the recycle bin!
Declaration
void DeleteSiteCollection(Uri siteToDelete, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
siteToDelete
Site collection to delete |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
DeleteSiteCollectionAsync(Uri, VanityUrlOptions)
Deletes a site collection. The deleted site collection is also removed from the recycle bin!
Declaration
Task DeleteSiteCollectionAsync(Uri siteToDelete, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
siteToDelete
Site collection to delete |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task
|
EnableCommunicationSiteFeatures(Uri)
Enables the communication site features on this team site using the Topic design. Requirements:
- Only works when the site collection was not connected to an Microsoft 365 group
- Web is root web of the site collection, cannot be applied to sub sites
- Web template is "STS#0" or "EHS#1" (so TeamSite)
Declaration
void EnableCommunicationSiteFeatures(Uri site)
Parameters
Uri
site
Url of the team site collection to enable communication site features for |
EnableCommunicationSiteFeatures(Uri, Guid)
Enables the communication site features on this team site using the Topic design. Requirements:
- Use 96c933ac-3698-44c7-9f4a-5fd17d71af9e (Topic), 6142d2a0-63a5-4ba0-aede-d9fefca2c767 (Showcase) or f6cc5403-0d63-442e-96c0-285923709ffc (Blank) as design package id
- Only works when the site collection was not connected to an Microsoft 365 group
- Web is root web of the site collection, cannot be applied to sub sites
- Web template is "STS#0" or "EHS#1" (so TeamSite)
Declaration
void EnableCommunicationSiteFeatures(Uri site, Guid designPackageId)
Parameters
Uri
site
Url of the team site collection to enable communication site features for |
Guid
designPackageId
Design package id to apply |
EnableCommunicationSiteFeaturesAsync(Uri)
Enables the communication site features on this team site using the Topic design. Requirements:
- Only works when the site collection was not connected to an Microsoft 365 group
- Web is root web of the site collection, cannot be applied to sub sites
- Web template is "STS#0" or "EHS#1" (so TeamSite)
Declaration
Task EnableCommunicationSiteFeaturesAsync(Uri site)
Parameters
Uri
site
Url of the team site collection to enable communication site features for |
Returns
Task
|
EnableCommunicationSiteFeaturesAsync(Uri, Guid)
Enables the communication site features on this team site using the Topic design. Requirements:
- Use 96c933ac-3698-44c7-9f4a-5fd17d71af9e (Topic), 6142d2a0-63a5-4ba0-aede-d9fefca2c767 (Showcase) or f6cc5403-0d63-442e-96c0-285923709ffc (Blank) as design package id
- Only works when the site collection was not connected to an Microsoft 365 group
- Web is root web of the site collection, cannot be applied to sub sites
- Web template is "STS#0" or "EHS#1" (so TeamSite)
Declaration
Task EnableCommunicationSiteFeaturesAsync(Uri site, Guid designPackageId)
Parameters
Uri
site
Url of the team site collection to enable communication site features for |
Guid
designPackageId
Design package id to apply |
Returns
Task
|
GetLegacyServicePrincipals(Boolean, VanityUrlOptions)
Gets a list of legacy service principals which are required when using the GetTenantAndSiteCollectionACSPrincipals(List<ILegacyServicePrincipal>, Boolean, VanityUrlOptions) method.
Declaration
List<ILegacyServicePrincipal> GetLegacyServicePrincipals(bool includeExpiredPrincipals = false, VanityUrlOptions vanityUrlOptions = null)
Parameters
System.Boolean
includeExpiredPrincipals
Also include the legacy service principals for which the password credential has expired |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
List<ILegacyServicePrincipal>
List of legacy service principals |
GetLegacyServicePrincipalsAsync(Boolean, VanityUrlOptions)
Gets a list of legacy service principals which are required when using the GetTenantAndSiteCollectionACSPrincipalsAsync(List<ILegacyServicePrincipal>, Boolean, VanityUrlOptions) method.
Declaration
Task<List<ILegacyServicePrincipal>> GetLegacyServicePrincipalsAsync(bool includeExpiredPrincipals = false, VanityUrlOptions vanityUrlOptions = null)
Parameters
System.Boolean
includeExpiredPrincipals
Also include the legacy service principals for which the password credential has expired |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task<List<ILegacyServicePrincipal>>
List of legacy service principals |
GetRecycledSiteCollections(VanityUrlOptions)
Returns a list of the recycled site collections in the current tenant including details about the site. This method queries a hidden list in the SharePoint Tenant Admin site and therefore requires the user or application to have the proper permissions
Declaration
List<IRecycledSiteCollection> GetRecycledSiteCollections(VanityUrlOptions vanityUrlOptions = null)
Parameters
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
List<IRecycledSiteCollection>
A list of site collections with details |
GetRecycledSiteCollectionsAsync(VanityUrlOptions)
Returns a list of the recycled site collections in the current tenant including details about the site. This method queries a hidden list in the SharePoint Tenant Admin site and therefore requires the user or application to have the proper permissions
Declaration
Task<List<IRecycledSiteCollection>> GetRecycledSiteCollectionsAsync(VanityUrlOptions vanityUrlOptions = null)
Parameters
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task<List<IRecycledSiteCollection>>
A list of site collections with details |
GetSiteCollectionACSPrincipals(Boolean, VanityUrlOptions)
Gets a list of Azure ACS principals that are scoped to the current site and optionally it's subsites. A Azure ACS principal granted tenant level permissions will not be included here. If you need that then use the GetTenantAndSiteCollectionACSPrincipals(List<ILegacyServicePrincipal>, Boolean, VanityUrlOptions) method.
Declaration
List<IACSPrincipal> GetSiteCollectionACSPrincipals(bool includeSubsites = true, VanityUrlOptions vanityUrlOptions = null)
Parameters
System.Boolean
includeSubsites
Also load the Azure ACS principals for the subsites. This is relevant when a principal was granted web or list permissions but no site permissions |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
List<IACSPrincipal>
A list of Azure ACS principals |
GetSiteCollectionACSPrincipalsAsync(Boolean, VanityUrlOptions)
Gets a list of Azure ACS principals that are scoped to the current site and optionally it's subsites. A Azure ACS principal granted tenant level permissions will not be included here. If you need that then use the GetTenantAndSiteCollectionACSPrincipalsAsync(List<ILegacyServicePrincipal>, Boolean, VanityUrlOptions) method.
Declaration
Task<List<IACSPrincipal>> GetSiteCollectionACSPrincipalsAsync(bool includeSubsites = true, VanityUrlOptions vanityUrlOptions = null)
Parameters
System.Boolean
includeSubsites
Also load the Azure ACS principals for the subsites. This is relevant when a principal was granted web or list permissions but no site permissions |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task<List<IACSPrincipal>>
A list of Azure ACS principals |
GetSiteCollectionAdmins(Uri, VanityUrlOptions)
Gets the administrators of the site collection
Declaration
List<ISiteCollectionAdmin> GetSiteCollectionAdmins(Uri site, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
site
Url of the site collection to get the administrators for |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
List<ISiteCollectionAdmin>
The list of site collection administrators |
GetSiteCollectionAdminsAsync(Uri, VanityUrlOptions)
Gets the administrators of the site collection
Declaration
Task<List<ISiteCollectionAdmin>> GetSiteCollectionAdminsAsync(Uri site, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
site
Url of the site collection to get the administrators for |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task<List<ISiteCollectionAdmin>>
The list of site collection administrators |
GetSiteCollectionProperties(Uri, VanityUrlOptions)
Returns the properties of a site collection
Declaration
ISiteCollectionProperties GetSiteCollectionProperties(Uri site, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
site
Site collection to get the properties for |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
ISiteCollectionProperties
The site collection properties |
GetSiteCollectionPropertiesAsync(Uri, VanityUrlOptions)
Returns the properties of a site collection
Declaration
Task<ISiteCollectionProperties> GetSiteCollectionPropertiesAsync(Uri site, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
site
Site collection to get the properties for |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task<ISiteCollectionProperties>
The site collection properties |
GetSiteCollections(Boolean, SiteCollectionFilter, VanityUrlOptions)
Returns the list of site collections. When using application permissions or a delegated permissions for a SharePoint admin account all site collections are returned, otherwise only the site collections accessible by the requesting user are returned. Under the covers this method uses different approaches:
- Application permissions: using the Sites endpoint via Graph
- Delegated permissions, user is SharePoint Tenant Admin: querying the sites list maintained in the SharePoint Tenant Admin site
- Delegated permissions, non admin: using the Search endpoint via Graph
Declaration
List<ISiteCollection> GetSiteCollections(bool ignoreUserIsSharePointAdmin = false, SiteCollectionFilter filter = default(SiteCollectionFilter), VanityUrlOptions vanityUrlOptions = null)
Parameters
System.Boolean
ignoreUserIsSharePointAdmin
When set to true and when the user is SharePoint admin then only return the site collections accessible by the user |
SiteCollectionFilter
filter
Optional filter to scope the returned site collections |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
List<ISiteCollection>
A list of site collections |
GetSiteCollectionsAsync(Boolean, SiteCollectionFilter, VanityUrlOptions)
Returns the list of site collections. When using application permissions or a delegated permissions for a SharePoint admin account all site collections are returned, otherwise only the site collections accessible by the requesting user are returned. Under the covers this method uses different approaches:
- Application permissions: using the Sites endpoint via Graph
- Delegated permissions, user is SharePoint Tenant Admin: querying the sites list maintained in the SharePoint Tenant Admin site
- Delegated permissions, non admin: using the Search endpoint via Graph
Declaration
Task<List<ISiteCollection>> GetSiteCollectionsAsync(bool ignoreUserIsSharePointAdmin = false, SiteCollectionFilter filter = default(SiteCollectionFilter), VanityUrlOptions vanityUrlOptions = null)
Parameters
System.Boolean
ignoreUserIsSharePointAdmin
When set to true and when the user is SharePoint admin then only return the site collections accessible by the user |
SiteCollectionFilter
filter
Optional filter to scope the returned site collections |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task<List<ISiteCollection>>
A list of site collections |
GetSiteCollectionSharePointAddIns(Boolean, VanityUrlOptions, Boolean)
Gets a list of SharePoint AddIns that are scoped to the current site and optionally it's subsites.
Declaration
List<ISharePointAddIn> GetSiteCollectionSharePointAddIns(bool includeSubsites = true, VanityUrlOptions vanityUrlOptions = null, bool loadLegacyPrincipalData = true)
Parameters
System.Boolean
includeSubsites
Also load the SharePoint AddIns for the subsites |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
System.Boolean
loadLegacyPrincipalData
Optionally do not load the related legacy principal with permission data |
Returns
List<ISharePointAddIn>
A list of SharePoint AddIns |
GetSiteCollectionSharePointAddInsAsync(Boolean, VanityUrlOptions, Boolean)
Gets a list of SharePoint AddIns that are scoped to the current site and optionally it's subsites.
Declaration
Task<List<ISharePointAddIn>> GetSiteCollectionSharePointAddInsAsync(bool includeSubsites = true, VanityUrlOptions vanityUrlOptions = null, bool loadLegacyPrincipalData = true)
Parameters
System.Boolean
includeSubsites
Also load the SharePoint AddIns for the subsites |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
System.Boolean
loadLegacyPrincipalData
Optionally do not load the related legacy principal with permission data |
Returns
Task<List<ISharePointAddIn>>
A list of SharePoint AddIns |
GetSiteCollectionsWithDetails(VanityUrlOptions, Boolean)
Returns a list of the site collections in the current tenant including details about the site. This method queries a hidden list in the SharePoint Tenant Admin site and therefore requires the user or application to have the proper permissions
Declaration
List<ISiteCollectionWithDetails> GetSiteCollectionsWithDetails(VanityUrlOptions vanityUrlOptions = null, bool includeSharedAndPrivateTeamChannelSites = false)
Parameters
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
System.Boolean
includeSharedAndPrivateTeamChannelSites
Optionally include the site collections behind shared and private Microsoft Teams channels |
Returns
List<ISiteCollectionWithDetails>
A list of site collections with details |
GetSiteCollectionsWithDetailsAsync(VanityUrlOptions, Boolean)
Returns a list of the site collections in the current tenant including details about the site. This method queries a hidden list in the SharePoint Tenant Admin site and therefore requires the user or application to have the proper permissions
Declaration
Task<List<ISiteCollectionWithDetails>> GetSiteCollectionsWithDetailsAsync(VanityUrlOptions vanityUrlOptions = null, bool includeSharedAndPrivateTeamChannelSites = false)
Parameters
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
System.Boolean
includeSharedAndPrivateTeamChannelSites
Optionally include the site collections behind shared and private Microsoft Teams channels |
Returns
Task<List<ISiteCollectionWithDetails>>
A list of site collections with details |
GetSiteCollectionWebsWithDetails(Uri, Boolean)
Returns a list of all sub sites for the passed in site collection If the current context or passed url are for a sub web then the all sub webs of that sub web are returned
Declaration
List<IWebWithDetails> GetSiteCollectionWebsWithDetails(Uri url = null, bool skipAppWebs = true)
Parameters
Uri
url
Optional URL of the site collection to get the sub sites for. If null the sub sites are retreived for the current site collection |
System.Boolean
skipAppWebs
Skips the SharePoint app webs (APP#0) |
Returns
List<IWebWithDetails>
List of webs with details |
GetSiteCollectionWebsWithDetailsAsync(Uri, Boolean)
Returns a list of all sub sites for the passed in site collection If the current context or passed url are for a sub web then the all sub webs of that sub web are returned
Declaration
Task<List<IWebWithDetails>> GetSiteCollectionWebsWithDetailsAsync(Uri url = null, bool skipAppWebs = true)
Parameters
Uri
url
Optional URL of the site collection to get the sub sites for. If null the sub sites are retreived for the current site collection |
System.Boolean
skipAppWebs
Skips the SharePoint app webs (APP#0) |
Returns
Task<List<IWebWithDetails>>
List of webs with details |
GetSiteCollectionWithDetails(Uri, VanityUrlOptions)
Returns details about the requested site. This method queries a hidden list in the SharePoint Tenant Admin site and therefore requires the user or application to have the proper permissions
Declaration
ISiteCollectionWithDetails GetSiteCollectionWithDetails(Uri url, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
url
Uri of the site collection to get details for |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
ISiteCollectionWithDetails
Site collection details, null if the passed site was not found |
GetSiteCollectionWithDetailsAsync(Uri, VanityUrlOptions)
Returns details about the requested site. This method queries a hidden list in the SharePoint Tenant Admin site and therefore requires the user or application to have the proper permissions
Declaration
Task<ISiteCollectionWithDetails> GetSiteCollectionWithDetailsAsync(Uri url, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
url
Uri of the site collection to get details for |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task<ISiteCollectionWithDetails>
Site collection details, null if the passed site was not found |
GetTenantACSPrincipals(List<ILegacyServicePrincipal>, VanityUrlOptions)
Gets a list of Azure ACS principals that are scoped tenant wide. For performance reason this method
requires the input of a
Declaration
List<IACSPrincipal> GetTenantACSPrincipals(List<ILegacyServicePrincipal> legacyServicePrincipals, VanityUrlOptions vanityUrlOptions = null)
Parameters
List<ILegacyServicePrincipal>
legacyServicePrincipals
List of legacy service principals to include |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
List<IACSPrincipal>
A list of Azure ACS principals |
GetTenantACSPrincipalsAsync(List<ILegacyServicePrincipal>, VanityUrlOptions)
Gets a list of Azure ACS principals that are scoped tenant wide. For performance reason this method
requires the input of a
Declaration
Task<List<IACSPrincipal>> GetTenantACSPrincipalsAsync(List<ILegacyServicePrincipal> legacyServicePrincipals, VanityUrlOptions vanityUrlOptions = null)
Parameters
List<ILegacyServicePrincipal>
legacyServicePrincipals
List of legacy service principals to include |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task<List<IACSPrincipal>>
A list of Azure ACS principals |
GetTenantAndSiteCollectionACSPrincipals(List<ILegacyServicePrincipal>, Boolean, VanityUrlOptions)
Gets a list of Azure ACS principals that are scoped to the current site and/or scoped tenant wide. For performance reason this method
requires the input of a
Declaration
List<IACSPrincipal> GetTenantAndSiteCollectionACSPrincipals(List<ILegacyServicePrincipal> legacyServicePrincipals, bool includeSubsites = true, VanityUrlOptions vanityUrlOptions = null)
Parameters
List<ILegacyServicePrincipal>
legacyServicePrincipals
List of legacy service principals to include |
System.Boolean
includeSubsites
Also load the Azure ACS principals for the subsites. This is relevant when a principal was granted web or list permissions but no site permissions |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
List<IACSPrincipal>
|
GetTenantAndSiteCollectionACSPrincipalsAsync(List<ILegacyServicePrincipal>, Boolean, VanityUrlOptions)
Gets a list of Azure ACS principals that are scoped to the current site and/or scoped tenant wide. For performance reason this method
requires the input of a
Declaration
Task<List<IACSPrincipal>> GetTenantAndSiteCollectionACSPrincipalsAsync(List<ILegacyServicePrincipal> legacyServicePrincipals, bool includeSubsites = true, VanityUrlOptions vanityUrlOptions = null)
Parameters
List<ILegacyServicePrincipal>
legacyServicePrincipals
List of legacy service principals to include |
System.Boolean
includeSubsites
Also load the Azure ACS principals for the subsites. This is relevant when a principal was granted web or list permissions but no site permissions |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task<List<IACSPrincipal>>
A list of Azure ACS principals |
HideAddTeamsPrompt(Uri)
Hides the Add Microsoft Teams banner. Only works when the site collection was already connected to an Microsoft 365 group
Declaration
bool HideAddTeamsPrompt(Uri site)
Parameters
Uri
site
Url of the site collection to hide the Add Teams prompt for |
Returns
System.Boolean
True if hidden |
HideAddTeamsPromptAsync(Uri)
Hides the Add Microsoft Teams banner. Only works when the site collection was already connected to an Microsoft 365 group
Declaration
Task<bool> HideAddTeamsPromptAsync(Uri site)
Parameters
Uri
site
Url of the site collection to hide the Add Teams prompt for |
Returns
Task<System.Boolean>
True if hidden |
IsAddTeamsPromptHidden(Uri)
Checks if the Add Microsoft Teams banner is hidden. Only works when the site collection was already connected to an Microsoft 365 group.
Declaration
bool IsAddTeamsPromptHidden(Uri site)
Parameters
Uri
site
Url of the site collection to check the Add Teams prompt status for |
Returns
System.Boolean
True if hidden, false otherwise. |
IsAddTeamsPromptHiddenAsync(Uri)
Checks if the Add Microsoft Teams banner is hidden. Only works when the site collection was already connected to an Microsoft 365 group
Declaration
Task<bool> IsAddTeamsPromptHiddenAsync(Uri site)
Parameters
Uri
site
Url of the site collection to check the Add Teams prompt status for |
Returns
Task<System.Boolean>
True if hidden, false otherwise. |
RecycleSiteCollection(Uri, VanityUrlOptions)
Recycle a site collection. The site collection ends up in the recycle bin and can be restored. When the site collection has a connected group then also that group is automatically recycled
Declaration
void RecycleSiteCollection(Uri siteToDelete, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
siteToDelete
Site collection to recycle |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
RecycleSiteCollectionAsync(Uri, VanityUrlOptions)
Recycle a site collection. The site collection ends up in the recycle bin and can be restored. When the site collection has a connected group then also that group is automatically recycled
Declaration
Task RecycleSiteCollectionAsync(Uri siteToDelete, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
siteToDelete
Site collection to recycle |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task
|
RestoreSiteCollection(Uri, VanityUrlOptions)
Restores a site collection from the recycle bin. When the site collection has a connected group then also that group is automatically restored
Declaration
void RestoreSiteCollection(Uri siteToRestore, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
siteToRestore
Site collection to restore |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
RestoreSiteCollectionAsync(Uri, VanityUrlOptions)
Restores a site collection from the recycle bin. When the site collection has a connected group then also that group is automatically restored
Declaration
Task RestoreSiteCollectionAsync(Uri siteToRestore, VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
siteToRestore
Site collection to restore |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task
|
SetSiteCollectionAdmins(Uri, List<String>, List<Guid>, CollectionUpdateOptions, VanityUrlOptions)
Sets the administrators of the site collection by providing the list of login names. The first in the list will be the primary admin, the others will be secondary admins. When the site collection is group connected you can also opt to set group owners as they are also SharePoint site collection administrators. To stay in sync with with SharePoint Tenant admin center does, when adding a group owner the user is also added as group member. Note that this method does not remove existing admins, it only adds the provided admins.
Declaration
void SetSiteCollectionAdmins(Uri site, List<string> sharePointAdminLoginNames = null, List<Guid> ownerGroupAzureAdUserIds = null, CollectionUpdateOptions collectionUpdateOptions = default(CollectionUpdateOptions), VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
site
Url of the site collection to set the administrators for |
List<System.String>
sharePointAdminLoginNames
List of SharePoint Admins login names (e.g. i:0#.f|membership|anna@contoso.onmicrosoft.com) to set as admin |
List<Guid>
ownerGroupAzureAdUserIds
List of Azure AD user ids to set as admin via adding them to the connected Microsoft 365 group owners |
CollectionUpdateOptions
collectionUpdateOptions
Add new admins to the list of admins with 'AddOnly' (default), or set exactly the submitted list using 'SetExact' |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
SetSiteCollectionAdminsAsync(Uri, List<String>, List<Guid>, CollectionUpdateOptions, VanityUrlOptions)
Sets the administrators of the site collection by providing the list of login names. The first in the list will be the primary admin, the others will be secondary admins. When the site collection is group connected you can also opt to set group owners as they are also SharePoint site collection administrators. To stay in sync with with SharePoint Tenant admin center does, when adding a group owner the user is also added as group member. Note that this method does not remove existing admins, it only adds the provided admins.
Declaration
Task SetSiteCollectionAdminsAsync(Uri site, List<string> sharePointAdminLoginNames = null, List<Guid> ownerGroupAzureAdUserIds = null, CollectionUpdateOptions collectionUpdateOptions = default(CollectionUpdateOptions), VanityUrlOptions vanityUrlOptions = null)
Parameters
Uri
site
Url of the site collection to set the administrators for |
List<System.String>
sharePointAdminLoginNames
List of SharePoint Admins login names (e.g. i:0#.f|membership|anna@contoso.onmicrosoft.com) to set as admin |
List<Guid>
ownerGroupAzureAdUserIds
List of Azure AD user ids to set as admin via adding them to the connected Microsoft 365 group owners |
CollectionUpdateOptions
collectionUpdateOptions
Add new admins to the list of admins with 'AddOnly' (default), or set exactly the submitted list using 'SetExact' |
VanityUrlOptions
vanityUrlOptions
Optionally specify the custom vanity URI's used by this tenant |
Returns
Task
|
SiteExists(Uri)
Check if site exists
Declaration
bool SiteExists(Uri url)
Parameters
Uri
url
Site url |
Returns
System.Boolean
True if the site exists, false otherwise |
SiteExistsAsync(Uri)
Check if site exists
Declaration
Task<bool> SiteExistsAsync(Uri url)
Parameters
Uri
url
Site url |
Returns
Task<System.Boolean>
True if the site exists, false otherwise |