Set-SPOApplication

Sets or updates one or more configuration of a SharePoint Embedded application.

Syntax

Default (Default)

Set-SPOApplication
    [-OwningApplicationId] <Guid>
    [[-SharingCapability] <SharingCapabilities>]
    [[-OverrideTenantSharingCapability] <Boolean>]
    [[-CopilotEmbeddedChatHosts] <System.Collections.Generic.List`1[System.String]>]
    [[-ItemMajorVersionLimit] <Int>]
    [[-EnableAutoExpirationVersionTrim] <Boolean>]
    [[-ExpireVersionsAfterDays] <Int>]
    [[-FileTypesForVersionExpiration] <String[]>]
    [[-RemoveVersionExpirationFileTypeOverride] <String[]>]
    [<CommonParameters>]

Description

Set-SPOApplication cmdlet is used to set the configuration properties of a specific application, determined by the OwningApplicationId.

You must be a SharePoint Embedded Administrator to run this cmdlet.

Note

The OwningApplicationId for Microsoft Loop is a187e399-0c36-4b98-8f04-1edc167a0996. The OwningApplicationId for Microsoft Designer is 5e2795e3-ce8c-4cfb-b302-35fe5cd01597.

To invite people outside your organization, please make sure Microsoft Entra B2B is enabled.

Examples

Example 1

Set-SPOApplication -OwningApplicationId 423poi45-jikl-9bnm-b302-1234ghy56789 -OverrideTenantSharingCapability $false

This example disables the override sharing capability, aligning this SharePoint Embedded application's sharing settings with sharing capability of the SharePoint Online.

Example 2

Set-SPOApplication -OwningApplicationId 423poi45-jikl-9bnm-b302-1234ghy56789 -OverrideTenantSharingCapability $true -SharingCapability Disabled

This example enables the override, restricting file sharing within the SharePoint Embedded application to internal company users only, regardless of the broader SharePoint Online tenant settings.

Example 3

Set-SPOTenant -EnableAzureADB2BIntegration $true
Set-SPOApplication -OwningApplicationId 423poi45-jikl-9bnm-b302-1234ghy56789 -OverrideTenantSharingCapability $true -SharingCapability ExternalUserandGuestSharing

This example demonstrates how to enable file sharing within the SharePoint Embedded application for external users. Note that B2B integration must be enabled to allow guest invitations to SharePoint Embedded apps.

Example 4

Set-SPOApplication -OwningApplicationId 423poi45 -CopilotEmbeddedChatHosts "https://localhost:3000 https://contoso.sharepoint.com https://fabrikam.com"

This example sets the host URLs for the application with Id 423poi45.

Example 5

Set-SPOApplication -OwningApplicationId 423poi45 -ItemMajorVersionLimit 1000

This example sets the ItemMajorVersionLimit to 1000.

Example 6

Set-SPOApplication -OwningApplicationId 423poi45 -EnableAutoExpirationVersionTrim $true

This example enables automatic version history trimming for the application's containers. When automatic trimming is enabled, ExpireVersionsAfterDays and ItemMajorVersionLimit are managed automatically and cannot be set at the same time.

Example 7

Set-SPOApplication -OwningApplicationId 423poi45 -EnableAutoExpirationVersionTrim $false -ItemMajorVersionLimit 500 -ExpireVersionsAfterDays 180

This example disables automatic trimming and sets a manual version policy. When EnableAutoExpirationVersionTrim is $false, both ItemMajorVersionLimit and ExpireVersionsAfterDays must be specified.

Example 8

Set-SPOApplication -OwningApplicationId 423poi45 -ExpireVersionsAfterDays 365 -FileTypesForVersionExpiration "docx","xlsx"

This example applies the version-expiration policy to the specified file types.

Example 9

Set-SPOApplication -OwningApplicationId 423poi45 -RemoveVersionExpirationFileTypeOverride "docx","xlsx"

This example removes the file-type version-expiration overrides for the specified file types. RemoveVersionExpirationFileTypeOverride cannot be combined with any other version policy parameter.

Parameters

-CopilotEmbeddedChatHosts

This parameter is used to add host URLs allowed to use the SharePoint Embedded application's declarative agent experience. This will always be a subset of permissible URLs set by the application's developer. To check the list of permissible URLs, use the Get-SPOApplication cmdlet.

Parameter properties

Type:

System.Collections.Generic.List`1[System.String]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableAutoExpirationVersionTrim

Enables or disables automatic file version history trimming for the SharePoint Embedded application's containers.

  • $true - Version history limits are managed automatically. ExpireVersionsAfterDays and ItemMajorVersionLimit cannot be specified at the same time.
  • $false - A manual version policy is used. Both ItemMajorVersionLimit and ExpireVersionsAfterDays must be specified.

Parameter properties

Type:System.Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:5
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExpireVersionsAfterDays

The number of days after which file versions expire. A value of 0 means versions never expire. Otherwise the value must be between 30 and 36500. This parameter cannot be used when EnableAutoExpirationVersionTrim is $true.

Parameter properties

Type:Int
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:6
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FileTypesForVersionExpiration

The file types whose version-expiration policy should be updated. The array cannot be empty, and at least one of EnableAutoExpirationVersionTrim, ItemMajorVersionLimit, or ExpireVersionsAfterDays must also be specified.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:7
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ItemMajorVersionLimit

This parameter is used to override ItemMajorVersionLimit for container types. Valid values are between 1 and 50000.

Parameter properties

Type:Int
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OverrideTenantSharingCapability

This setting allows the application to independently set its sharing capabilities, overriding the tenant-level settings of SharePoint Online. Options:

  • False (default) - The application follows the tenant-level sharing capability
  • True - The application's sharing settings are independent of the tenant level sharing capability

Parameter properties

Type:System.Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OwningApplicationId

This parameter specifies the ID of the SharePoint Embedded application.

Parameter properties

Type:System.Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveVersionExpirationFileTypeOverride

The file-type version-expiration overrides to remove. The array cannot be empty. This parameter is exclusive and cannot be combined with FileTypesForVersionExpiration, EnableAutoExpirationVersionTrim, ItemMajorVersionLimit, or ExpireVersionsAfterDays.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:8
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SharingCapability

Determines what level of sharing is available for the SharePoint Embedded Application.

The valid values are:

  • ExternalUserAndGuestSharing (default) - External user sharing (share by email) and guest link sharing are both enabled.
  • Disabled - External user sharing (share by email) and guest link sharing are both disabled.
  • ExternalUserSharingOnly - External user sharing (share by email) is enabled, but guest link sharing is disabled.
  • ExistingExternalUserSharingOnly - Only guests already in your organization's directory.

The default setting is None, meaning the application follows the SharePoint Online tenant-level sharing settings. Use the Get-SPOTenant cmdlet to view these settings.

Parameter properties

Type:Microsoft.Online.SharePoint.TenantManagement.SharingCapabilities
Default value:None
Accepted values:Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object