SharePointOnlinePowerShell

The following cmdlet references are for SharePoint Online.

SharePointOnlinePowerShell

Add-SPOGeoAdministrator

Adds a new SharePoint user or security group as GeoAdministrator to a multi-geo tenant.

Add-SPOHubSiteAssociation

Associates a site with a hub site.

Add-SPOHubToHubAssociation

Associates a hub site to a hub site. Note: This feature is currently in preview and may not be available in your tenant.

Add-SPOOrgAssetsLibrary

Designates a library to be used as a central location for organization assets across the tenant.

Add-SPOSiteCollectionAppCatalog

Adds a Site Collection scoped App Catalog to a site.

Add-SPOSiteDesign

Creates a new site design available to users when they create a new site from the SharePoint home page.

Add-SPOSiteDesignTask

Similar to Invoke-SPOSiteDesign, this command is used to apply a published site design to a specified site collection target. It schedules the operation, allowing for the application of larger site scripts (Invoke-SPOSiteDesign is limited to 30 actions and subactions).

The supported site templates you can apply a site design to include: "modern" team site (with O365 group), "modern" team site (without an O365 group); communication site; classic team site; and classic publishing site.

Add-SPOSiteScript

Uploads a new site script for use either directly or in a site design.

Add-SPOTenantCdnOrigin

Configures a new origin to public or private content delivery network (CDN). Requires Tenant administrator permissions.

Add-SPOTheme

Creates a new custom theme, or overwrites an existing theme to modify its settings.

Add-SPOUser

Adds an existing Office 365 user or an Office 365 security group to a SharePoint group.

Approve-SPOTenantServicePrincipalPermissionGrant

Approves a permission request for the current tenant's "SharePoint Online Client" service principal.

Approve-SPOTenantServicePrincipalPermissionRequest

Approves a permission request for the current tenant's "SharePoint Online Client" service principal

Connect-SPOService

Connects a SharePoint Online administrator or Global Administrator to a SharePoint Online connection (the SharePoint Online Administration Center). This cmdlet must be run before any other SharePoint Online cmdlets can run.

ConvertTo-SPOMigrationEncryptedPackage

Use this Cmdlet to convert your XML files into a new encrypted migration package.

ConvertTo-SPOMigrationTargetedPackage

Use this cmdlet to convert your XML files into a new migration package.

Deny-SPOTenantServicePrincipalPermissionRequest

Denies a permission request for the current tenant's "SharePoint Online Client" service principal

Disable-SPOTenantServicePrincipal

Disables the current tenant's "SharePoint Online Client" service principal.

Disconnect-SPOService

Disconnects from a SharePoint Online service.

Enable-SPOCommSite

Enables the communication site experience on an existing classic team site. Please read instructions in modernize classic team site before attempting to execute this cmdlet.

Enable-SPOTenantServicePrincipal

Enables the current tenant's "SharePoint Online Client" service principal.

Export-SPOQueryLogs

Export query logs for a user in an Office 365 tenant.

Export-SPOUserInfo

Export user information from site user information list.

Export-SPOUserProfile

Export user profile data to csv file.

Get-FileSensitivityLabelInfo

Extracts and displays the sensitivity label related information attached to an office file stored in SharePoint.

Get-SPOAppErrors

Returns application errors.

Get-SPOAppInfo

Returns all installed applications.

Get-SPOBrowserIdleSignOut

Used to retrieve the current configuration values for Idle session sign-out policy.

Get-SPOBuiltInDesignPackageVisibility

Gets the visibility of the available built-in Design Packages.

Get-SPOCrossGeoMovedUsers

In a multi-geo tenant returns the SharePoint Online user (or users) that had been moved.

Get-SPOCrossGeoMoveReport

Provides a report of objects moved between geo locations.

Get-SPOCrossGeoUsers

Returns the SharePoint Online users in a multi-geo tenant that match the criteria.

Get-SPODataEncryptionPolicy

.

Get-SPODeletedSite

Returns all deleted site collections from the Recycle Bin.

Get-SPOExternalUser

Returns external users in the tenant.

Get-SPOGeoAdministrator

This cmdlet returns the SharePoint Online user or security group accounts with global administrative privileges in the current Multi-Geographics tenant.

Get-SPOGeoMoveCrossCompatibilityStatus

This cmdlet returns the compatibility status between geographic locations.

Get-SPOGeoStorageQuota

This cmdlet gets the storage quota on a multi-geo tenant.

Get-SPOHideDefaultThemes

Queries the current SPOHideDefaultThemes setting. SPO stands for SharePoint Online.

Get-SPOHomeSite

Returns the home site url for your tenant.

Get-SPOHubSite

Lists hub sites or hub site information.

Get-SPOMigrationJobProgress

This cmdlet lets you report on SPO migration jobs that are in progress.

Get-SPOMigrationJobStatus

Use this cmdlet to monitor the status of a submitted SharePoint Online migration job.

Get-SPOMultiGeoCompanyAllowedDataLocation

Returns the SharePoint Online Multi geo allowed data locations.

Get-SPOMultiGeoExperience

Use this cmdlet to get the multi geo experience mode.

Get-SPOOrgAssetsLibrary

Displays information about all libraries designated as locations for organization assets.

Get-SPOOrgNewsSite

Lists URLs of all the configured organizational news sites. Requires Tenant administrator permissions.

Get-SPOPublicCdnOrigins

This cmdlet returns a list of CDN Origins in your SharePoint Online Tenant

Get-SPOSite

Returns one or more site collections.

Get-SPOSiteCollectionAppCatalogs

Use this cmdlet to get the Site Collection App Catalog.

Get-SPOSiteContentMoveState

This Cmdlet allows a SharePoint administrators to check the status of a site or group move.

Get-SPOSiteDataEncryptionPolicy

Validates the encryption of a Group Site, Team Site, or OneDrive for Business site if a Customer Key has been registered for the site.

Get-SPOSiteDesign

Gets details about site designs that are on the SharePoint tenant. You can specify an ID of a specific site design to retrieve. If there are no parameters listed, details about all site designs are listed.

Get-SPOSiteDesignRights

Displays a list of principals and their rights for usage of the site design. This can be used to determine the scope that your site design has with users on the tenant.

Get-SPOSiteDesignRun

Retrieves a list of site designs applied to a specified site collection.

Get-SPOSiteDesignRunStatus

Retrieves and displays a list of all site script actions executed for a specified site design applied to a site.

Get-SPOSiteDesignTask

Cmdlet to get a scheduled site design script.

Get-SPOSiteGroup

Gets all the groups on the specified site collection.

Get-SPOSiteRenameState

Returns the current rename job state of a SharePoint Online Site.

Get-SPOSiteScript

Displays information about existing site scripts.

Get-SPOSiteScriptFromList

Creates site script syntax from an existing SharePoint list.

Get-SPOSiteScriptFromWeb

Creates site script syntax from an existing SharePoint site.

Get-SPOSiteUserInvitations

Searches against all stored sharing links and retrieves the email invites.

Get-SPOStorageEntity

Tenant properties allow tenant administrators to add properties in the app catalog that can be read by various SharePoint Framework components. Because tenant properties are stored in the tenant app catalog, you must provide the tenant app catalog site collection URL or the site collection app catalog URL in the following cmdlets. This cmdlet is used to get a value in the property bag.

Get-SPOStructuralNavigationCacheSiteState

Get the structural navigation caching state for a site collection.

Get-SPOStructuralNavigationCacheWebState

Get the structural navigation caching state for a web.

Get-SPOTenant

Returns SharePoint Online organization properties.

Get-SPOTenantCdnEnabled

Returns whether Public content delivery network (CDN) or Private CDN is enabled on the tenant level. Requires Tenant administrator permissions.

Get-SPOTenantCdnOrigins

Lists all the configured origins under the tenancy or under a given site. You must be a SharePoint Online administrator or Global Administrator to run this cmdlet.

Get-SPOTenantCdnPolicies

Get the public or private Policies applied on your SharePoint Online Tenant. Requires Tenant administrator permissions.

Get-SPOTenantContentTypeReplicationParameters

Gets content types for replication parameters

Get-SPOTenantLogEntry

Retrieves SharePoint Online company logs. This cmdlet is reserved for internal Microsoft use.

Get-SPOTenantLogLastAvailableTimeInUtc

Returns the most recent time when the SharePoint Online organization logs were collected.

Get-SPOTenantOrgRelation

Note: Currently this cmdlet is part of pre-release functionality and may not function in your tenant.

Get-SPOTenantOrgRelationByPartner

Note: Currently this cmdlet is part of pre-release functionality and may not function in your tenant.

Get-SPOTenantOrgRelationByScenario

Note: Currently this cmdlet is part of pre-release functionality and may not function in your tenant.

Get-SPOTenantServicePrincipalPermissionGrants

Gets the collection of permission grants for the "SharePoint Online Client" service principal

Get-SPOTenantServicePrincipalPermissionRequests

Gets the collection of permission requests for the "SharePoint Online Client" service principal

Get-SPOTenantSyncClientRestriction

Returns the current configuration status.

Get-SPOTenantTaxonomyReplicationParameters

Get the replication parameters to manage Multi-Geo taxonomy replication.

Get-SPOTheme

Retrieves settings for an existing theme.

Get-SPOUnifiedGroup

Retrieves the Preferred Data Location for the specified Office 365 Group.

Get-SPOUnifiedGroupMoveState

Returns the state of an Office 365 Group move between Preferred Data Locations.

Get-SPOUser

Returns the SharePoint Online user or security group accounts that match a given search criteria.

Get-SPOUserAndContentMoveState

This cmdlet allows SharePoint administrators to check the status of a user or site move across geo locations.

Get-SPOUserOneDriveLocation

This cmdlet will return the user principal name, current location, and corresponding OneDrive for Business url, and the site ID. This cmdlet only supports Multi-Geo OneDrive sites.

Get-SPOWebTemplate

Displays all site templates that match the given identity.

Grant-SPOHubSiteRights

Grants rights to users or mail-enabled security groups to associate their site with a hub site.

Grant-SPOSiteDesignRights

Used to apply permissions to a set of users or a security group, effectively scoping the visibility of the site design in the UX. They start off public, but after you set permissions, only those groups or users with permissions can access the site design.

Invoke-SPOMigrationEncryptUploadSubmit

Creates a new migration job in the target site collection

Invoke-SPOSiteDesign

Applies a published site design to a specified site collection target. This allows a site design to be applied to an existing site collection. The supported site templates you can apply a site design to include: "modern" team site (with O365 group), "modern" team site (without an O365 group); communication site; classic team site; and classic publishing site.

Invoke-SPOSiteSwap

Invokes a job to swap the location of a site with another site while archiving the original site.

New-SPODataConnectionSetting

Creates a new Business Data Connectivity service connection.

New-SPOMigrationEncryptionParameters

Creates a new random encryption key for a migration job or package.

New-SPOMigrationPackage

Cmdlet to create a new migration package based on source files in a local or network shared folder.

New-SPOnlineApplicationPrincipalManagementServiceApplicationProxy

Creates a new SharePoint Online management Application Proxy Name

New-SPOPublicCdnOrigin

Creates a new public CDN on a document library in your SharePoint Online Tenant

New-SPOSdnProvider

Adds a new Software-Defined Networking (SDN) provider

New-SPOSite

Creates a new SharePoint Online site collection for the current company.

New-SPOSiteGroup

Creates a new group in a SharePoint Online site collection.

New-SPOTenantOrgRelation

Note: Currently this cmdlet is part of pre-release functionality and may not function in your tenant.

Register-SPODataEncryptionPolicy

Cmdlet to register customer encryption status for your geo tenant. For more information, see Controlling your data in Office 365 using Customer Key

Register-SPOHubSite

Enables the hub site feature on a site to make it a hub site. For more information visit SharePoint hub sites overview.

Remove-SPODataConnectionSetting

Removes a Business Connectivity Services connection.

Remove-SPODeletedSite

Removes a SharePoint Online deleted site collection from the Recycle Bin.

Remove-SPOExternalUser

Removes a collection of external users from the tenancy's folder.

Remove-SPOGeoAdministrator

Removes a new SharePoint user or security Group in the current Multi-Geo Tenant.

Remove-SPOHomeSite

Removes the current SharePoint Online Home site setting.

Remove-SPOHubSiteAssociation

Removes a site from its associated hub site.

Remove-SPOHubToHubAssociation

Removes the selected hub site from its parent hub.

Remove-SPOMigrationJob

Cmdlet to remove a previously created migration job from the specified site collection.

Remove-SPOMultiGeoCompanyAllowedDataLocation

Use this cmdlet to remove a multi geo allowed location.

Remove-SPOOrgAssetsLibrary

Removes a library that was designated as a central location for organization assets across the tenant.

Remove-SPOOrgNewsSite

Removes a given site from the list of organizational news sites based on its URL in your SharePoint Online Tenant

Remove-SPOPublicCdnOrigin

Removes a given public CDN origin based on its identity (id) in your SharePoint Online Tenant

Remove-SPOSdnProvider

Removes Software-Defined Networking (SDN) Support in your SharePoint Online tenant

Remove-SPOSite

Sends a SharePoint Online site collection to the SharePoint Online Recycle Bin.

Remove-SPOSiteCollectionAppCatalog

Removes the site collection app catalog.

Remove-SPOSiteCollectionAppCatalogById

Removes the site collection app catalog by the id of the site collection.

Remove-SPOSiteDesign

Removes a site design. It no longer appears in the UI for creating a new site.

Remove-SPOSiteDesignTask

Command to remove a scheduled site design script.

Remove-SPOSiteGroup

Removes a SharePoint Online group from a site collection.

Remove-SPOSiteScript

Removes a site script.

Remove-SPOSiteUserInvitations

.

Remove-SPOStorageEntity

Tenant properties allow tenant administrators to add properties in the app catalog that can be read by various SharePoint Framework components. Because tenant properties are stored in the tenant app catalog, you must provide the tenant app catalog site collection URL or the site collection app catalog URL in the following cmdlets. This cmdLet is used to remove a value in the property bag.

Remove-SPOTenantCdnOrigin

Removes a new origin from the Public or Private content delivery network (CDN). Requires Tenant administrator permissions.

Remove-SPOTenantOrgRelation

Note: Currently this cmdlet is part of pre-release functionality and may not function in your tenant.

Remove-SPOTenantSyncClientRestriction

Disables the feature for the tenancy.

Remove-SPOTheme

Removes a theme from the theme gallery.

Remove-SPOUser

Removes a user or a security group from a site collection or a group.

Remove-SPOUserInfo

Do not use.

Remove-SPOUserProfile

Remove user profile from the tenant.

Repair-SPOSite

Checks and repairs the site collection and its contents.

Request-SPOPersonalSite

Requests that one or more users be enqueued for a Personal Site to be created.

Request-SPOUpgradeEvaluationSite

Requests to create a copy of an existing site collection for the purposes of validating the effects of upgrade without affecting the original site.

Restore-SPODataEncryptionPolicy

CmdLet to restore customer encryption status for your geo tenant when in recovery mode. For more information, see Controlling your data in Office 365 using Customer Key

Restore-SPODeletedSite

Restores a SharePoint Online deleted site collection from the Recycle Bin.

Revoke-SPOHubSiteRights

Revokes rights for specified principals to a hub.

Revoke-SPOSiteDesignRights

Revokes rights for specified principals from a site design.

Revoke-SPOTenantServicePrincipalPermission

Revokes a permission that was previously granted to the "SharePoint Online Client" service principal

Revoke-SPOUserSession

Provides IT administrators the ability to invalidate a particular users' O365 sessions across all their devices.

Set-SPOBrowserIdleSignOut

Sets the current configuration values for Idle session sign-out.

Set-SPOBuiltInDesignPackageVisibility

Sets the visibility of the available built-in Design Packages at moment of site creation.

Set-SPODataConnectionSetting

Sets or updates global properties for a Microsoft Business Connectivity Services connection.

Set-SPODataConnectionSettingMetadata

Updates properties for the metadata of a Business Connectivity Services connection.

Set-SPODisableSpacesActivation

Disables the SharePoint Spaces activation.

Set-SPOGeoStorageQuota

This Cmdlet sets the Storage quota on a multi-geo tenant.

Set-SPOHideDefaultThemes

Specifies whether the default themes should be available.

Set-SPOHomeSite

Sets a SharePoint Site as a Home Site.

Set-SPOHubSite

Sets the hub site information such as name, logo, and description.

Set-SPOMigrationPackageAzureSource

Cmdlet to create Azure containers, upload migration package files into the appropriate containers and snapshot the uploaded content.

Set-SPOMultiGeoCompanyAllowedDataLocation

Adds a multi-geo allowed location.

Set-SPOMultiGeoExperience

Used to set a geo location into SPO mode.

Set-SPOOrgAssetsLibrary

Updates information for a library that is designated as a location for organization assets.

Set-SPOOrgNewsSite

Marks a site as one of multiple possible tenant's organizational news sites. Requires Global administrator or SharePoint administrator permissions.

Set-SPOSite

Sets or updates one or more properties' values for a site collection.

Set-SPOSiteDesign

Updates a previously uploaded site design.

Set-SPOSiteGroup

Updates the SharePoint Online owner and permission levels on a group inside a site collection.

Set-SPOSiteOffice365Group

Connects a top-level SPO site collection to a new Microsoft 365 Group.

Set-SPOSiteScript

Updates a previously uploaded site script.

Set-SPOStorageEntity

Tenant properties allow tenant administrators to add properties in the app catalog that can be read by various SharePoint Framework components. Because tenant properties are stored in the tenant app catalog, you must provide the tenant app catalog site collection URL or the site collection app catalog URL in the following cmdlets.

Set-SPOStructuralNavigationCacheSiteState

Enable or disable caching for all webs in a site collection.

Set-SPOStructuralNavigationCacheWebState

Enable or disable caching for a web in a site collection.

Set-SPOTenant

Sets properties on the SharePoint Online organization.

Set-SPOTenantCdnEnabled

Enables or disables Public content delivery network (CDN) or Private CDN on the tenant level. Requires Tenant administrator permissions.

Set-SPOTenantCdnPolicy

Sets the content delivery network (CDN) policies at the tenant level.

Set-SPOTenantContentTypeReplicationParameters

Select content types for replication

Set-SPOTenantSyncClientRestriction

Controls tenant-wide options and restrictions specific to syncing files.

Set-SPOTenantTaxonomyReplicationParameters

Select groups for replication

Set-SPOUnifiedGroup

Sets the Preferred Data Location (PDL) for the specified Office 365 Group. The customer tenant must be multi-geo enabled.

Set-SPOUser

Configures properties on an existing user.

Set-SPOWebTheme

Sets the theme for a SharePoint site.

Start-SPOSiteContentMove

Start a job to move a particular user or group of users to be moved across geo locations relative to the one that executes the command

Start-SPOSiteRename

Note

This Feature is part of the Admin Center Preview. If your tenant is not part of the Admin Center Preview, you will get an error when trying to run this cmdlet.

Starts a job to rename a site. You can change the title, the URL or both of a particular site on a SharePoint Online collection

Start-SPOUnifiedGroupMove

Initiates the move of an Office 365 Group to a new geo location

Start-SPOUserAndContentMove

Starts the ability to move a user closer to their sites.

Stop-SPOSiteContentMove

Stops a job to move a particular user or group of users to be moved across geo locations relative to the one that executes the command.

Stop-SPOUserAndContentMove

In a Multi-Geo company, stops the ability to move a user's content related objects in a SharePoint Online Tenant

Submit-SPOMigrationJob

Cmdlet to submit a new migration job referenced to a previously uploaded package in Azure Blob storage into to a site collection.

Test-SPOSite

Tests a SharePoint Online site collection.

Unlock-SensitivityLabelEncryptedFile

It removes encryption on a Sensitivity label encrypted file in SharePoint Online. No need to download the file.

Unregister-SPOHubSite

Disables the hub site feature on a site.

Update-SPODataEncryptionPolicy

Updates customer encryption status for a geo tenant.

Update-UserType

Updates the specified user's UserType value from Azure AD.

Upgrade-SPOSite

Starts the upgrade process on a site collection.

Verify-SPOTenantOrgRelation

Note: Currently this cmdlet is part of pre-release functionality and may not function in your tenant.