SPOTenant
S’applique à : SharePoint Online
Sets properties on the SharePoint Online organization.
You can use the Set-SPOTenant cmdlet to enable external services and to specify the versions in which site collections can be created. You can also use the Set-SPOSite cmdlet together with the Set-SPOTenant cmdlet to block access to a site in your organization and redirect traffic to another site.
You must be a SharePoint Online administrator to run the cmdlet.
Cmdlets disponibles
Paramètres
Exemples
EXAMPLE 1
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/team1 -LockState NoAccess
Set-SPOTenant -NoAccessRedirectUrl 'https://www.contoso.com' This example blocks access to https://contoso.sharepoint.com/sites/team1 and redirects traffic to https://www.contoso.com.
EXAMPLE 2
Set-SPOTenant -ShowEveryoneExceptExternalUsersClaim $false This example hides the "Everyone Except External Users" claim in People Picker.
EXAMPLE 3
Set-SPOTenant -ShowAllUsersClaim $false This example hides the "All Users" claim group in People Picker.
EXAMPLE 4
Set-SPOTenant -UsePersistentCookiesForExplorerView $true This example enables the use of special persisted cookie for Open with Explorer.
EXAMPLE 5
Set-SPOTenant -LegacyAuthProtocolsEnabled $True This example enables legacy authentication protocols on the tenant. This can help to enable login in situations where the admin users get an error like "Cannot contact web site 'https://contoso-admin.sharepoint.com/' or the web site does not support SharePoint Online credentials. The response status code is 'Unauthorized'.", and the underlying error is "Access denied. Before opening files in this location, you must first browse to the web site and select the option to login automatically."
EXAMPLE 6
Set-SPOTenant -ContentTypeSyncSiteTemplatesList MySites This example enables Content Type Hub to push content types to all OneDrive for Business sites. There is no change in Content Type Publishing behavior for other sites.
EXAMPLE 7
Set-SPOTenant -ContentTypeSyncSiteTemplatesList MySites -ExcludeSiteTemplate This example stops publishing content types to OneDrive for Business sites.
EXAMPLE 8
Set-SPOTenant -SearchResolveExactEmailOrUPN $true This example disables starts with for all users/partial name search functionality for all SharePoint users, except SharePoint Admins.
EXAMPLE 9
Set-SPOTenant -UseFindPeopleInPeoplePicker $true This example enables tenant admins to enable ODB and SPO to respect Exchange supports Address Book Policy (ABP) policies in the people picker.
EXAMPLE 10
Set-SPOTenant -ShowPeoplePickerSuggestionsForGuestUsers $true This example enables the option to search for existing guest users at Tenant Level.
EXAMPLE 11
Set-SPOTenant -EnableAutoExpirationVersionTrim $true This example sets automatic version history limits on all new document libraries at tenant level.
EXAMPLE 12
Set-SPOTenant -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -ExpireVersionsAfterDays 30 This example sets manual version history limits on all new document libraries at tenant level by limiting the number of major versions and the time (in days) versions are kept.
EXAMPLE 13
Set-SPOTenant -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -ExpireVersionsAfterDays 0 This example sets manual version history limits on all new document libraries at tenant level by limiting the number of major versions with no time limits.
EXAMPLE 14
Set-SPOTenant -SharingDomainRestrictionMode "AllowList" -SharingAllowedDomainList "contoso.com fabrikam.com" This example enables users to share with external collaborators from those domains only.
EXAMPLE 15
Set-SPOTenant -SharingDomainRestrictionMode "BlockList" -SharingBlockedDomainList "contoso.com" This example enables users to share with all external collaborators except for those on the BlockedDomainList.
EXAMPLE 16
Set-SPOTenant -EnableVersionExpirationSetting $true The EnableVersionExpirationSetting parameter is no longer active, this feature is now automatically enabled for each tenant. Setting EnableVersionExpirationSetting to false would not disable the feature. Learn more about Version History Settings
EXAMPLE 17
Set-SPOTenant -PrebuiltModelScope SelectedSites -PrebuiltModelSelectedSitesList "https://contoso.sharepoint.com/sites/site1","https://contoso.sharepoint.com/sites/site2" -PrebuiltModelSelectedSitesListOperation Append This example sets the scope of the prebuilt model and prebuilt document processing premium feature to SelectedSites, which limits the feature to only sites included in the selected sites list. This example also appends two sites to the feature's selected sites list.
Use of these parameters require the tenant to either have the required license or pay-as-you-go billing set up. For more information, visit Licensing for Microsoft Syntex.
EXAMPLE 18
Set-SPOTenant -DefaultContentCenterSite "https://contoso.sharepoint.com/sites/contentcenter" This example sets the tenant's default content center. It can only be used if the tenant does not already have a designated default content center. To learn more about content centers, visit Create a content center in Microsoft Syntex.
Use of this parameter requires the tenant to either have the required license or pay-as-you-go billing set up. For more information, visit Licensing for Microsoft Syntex.
EXAMPLE 19
$list = (Get-SPOTenant | Select-Object WhoCanShareAnonymousAllowList).WhoCanShareAnonymousAllowList
Set-SPOTenant –WhoCanShareAnonymousAllowList ($list + <new GUID>) This example appends a security group to the WhoCanShareAnonymousAllowList. Similar code works for the WhoCanShareAuthenticatedGuestAllowList.
EXAMPLE 20
Set-SPOTenant –WhoCanShareAnonymousAllowList @() This example empties the WhoCanShareAnonymousAllowList. Similar code works for the WhoCanShareAuthenticatedGuestAllowList.
EXAMPLE 21
Set-SPOTenant -DisabledAdaptiveCardExtensionIds 0d2d0fd0-9489-47ef-acfb-90edca009cba This example disables the Power Apps Adaptive Card Extension.
EXAMPLE 22
Set-SPOTenant -EnableAutoExpirationVersionTrim $true -FileTypesForVersionExpiration @("Video", "Audio") This example sets automatic version history limit override for video and audio file types on all new document libraries at tenant level.
EXAMPLE 23
Set-SPOTenant -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -ExpireVersionsAfterDays 30 -FileTypesForVersionExpiration @("Video", "Audio") This example sets manual version history limit override for video and audio file types on all new document libraries at tenant level by limiting the number of major versions and the time (in days) versions are kept.
EXAMPLE 24
Set-SPOTenant -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -ExpireVersionsAfterDays 0 -FileTypesForVersionExpiration @("Video", "Audio") This example sets manual version history limit override for video and audio file types on all new document libraries at tenant level by limiting the number of major versions with no time limits.
EXAMPLE 25
Set-SPOTenant -RemoveVersionExpirationFileTypeOverride @("Video", "Audio") This example removes any specific version history limit override set for video and audio file types on all new document libraries at tenant level.
EXAMPLE 26
Set-SPOTenant -IsFilePreviewDomainRestrictionEnabled $true -FilePreviewAllowedDomainList "contoso.com,fabrikam.com" This example restricts file preview to the specified domains. When domain restriction is enabled, only files embedded from the listed domains can be previewed, in addition to predefined trusted Microsoft domains (for example, teams.microsoft.com).
EXAMPLE 27
Set-SPOTenant -IsFilePreviewDomainRestrictionEnabled $false This example disables the file preview domain restriction. The previously configured allow list is retained but ignored, so the file preview viewer can load content from any domain.
EXAMPLE 28
Set-SPOTenant -DefaultLanguageForSiteCreation "de-DE" This example sets the default language for new OneDrive sites to German (Germany). New OneDrive sites created after you run this command use this language instead of the language of the organization's OneDrive host site. To clear the setting and return to the default behavior, pass an empty string: Set-SPOTenant -DefaultLanguageForSiteCreation "".
EXAMPLE 29
Set-SPOTenant -SmartWikiEntryScope AllSites This example makes the Smart Wiki library entry point available on all sites in the organization.
EXAMPLE 30
Set-SPOTenant -SmartWikiEntryScope IncludeSelectedSites -SmartWikiEntrySelectedSitesList "https://contoso.sharepoint.com/sites/marketing","https://contoso.sharepoint.com/sites/sales" This example makes the Smart Wiki library entry point available only on the two specified sites. The specified sites replace any previously selected sites.
EXAMPLE 31
Set-SPOTenant -SmartWikiEntrySelectedSitesList "https://contoso.sharepoint.com/sites/hr" -SmartWikiEntrySelectedSitesListOperation Append
Get-SPOTenant | Select-Object SmartWikiEntryScope, SmartWikiEntrySelectedSitesList This example adds a site to the current selected sites list for the Smart Wiki library entry point without changing the scope. It then displays the current scope and the selected sites.
EXAMPLE 32
Set-SPOTenant -RestrictAccessControlForAgenticUser $true
Get-SPOTenant | Select-Object RestrictAccessControlForAgenticUser This example restricts Agent Users from accessing all sites in the organization and then returns the configured value. The policy is enforced at runtime and doesn't remove existing permissions.