Sharepoint online management shell commands

Sharepoint online management shell commands DEFAULT

Most SharePoint administration functions are performed through the graphical portal interface. However, if you frequently perform the same tasks, you can automate them using PowerShell. Administrators can use PowerShell to manage various tasks in SharePoint. Microsoft provides separate sets of cmdlets for managing on-premises SharePoint and SharePoint Online. The number of PowerShell cmdlets for SharePoint Online is less than for the on-premises version of SharePoint.

Installing SharePoint Online Management Shell

To connect to SharePoint Online, you need to install SharePoint Online Management Shell. This PowerShell module allows you to manage SharePoint Online subscription in the Office 365. To install this module, PowerShell 3.0 (included in Windows Management Framework 3.0) must be installed on your computer. Download SharePoint Online Management Shell here:

https://www.microsoft.com/en-US/download/details.aspx?id=35588

Depending on your OS, you need to download 32 or 64 bit MSI distribution.

sharepoint online powershell commands

Installation of the module is quite simple. Just follow the instructions of the installation wizard.

sharepoint online powershell

After the installation is complete, you can start the SharePoint Online Management Shell from the Start menu, or import the SharePoint PowerShell module into your PoSh session:

Import-Module Microsoft.Online.SharePoint.PowerShell

sharepoint online management shell

SharePoint Online Management Shell Commands

A complete list of available commands of the module Microsoft.Online.SharePoint.PowerShell.dll can be displayed in the way like this:

Get-Command –Module Microsoft.Online.SharePoint.PowerShell

Alternatively, you can display all available SharePoint Online cmdlets using the command:

Get-Command *-SPO*

sharepoint online powershell scripts

The most frequently used cmdlets are listed below:

  • Add-SPOUser
  • Connect-SPOService
  • Disconnect-SPOService
  • Get-SPOExternalUser
  • Get-SPOSite
  • Get-SPOSiteGroup
  • Get-SPOTenant
  • Get-SPOUser
  • New-SPOSite
  • New-SPOSiteGroup
  • Remove-SPOSite
  • Remove-SPOSiteGroup
  • Remove-SPOUser
  • Set-SPOUser
  • Set-SPOUser
  • Test-SPOSite
  • Upgrade-SPOSite

Now you can connect to SharePoint using the Connect-SPOService cmdlet. If you are connecting to SharePoint Online, you need to specify the tenant URL and admin account name.

Connect-SPOService –Url https://theitbrostenant.sharepoint.com –Credential [email protected]

You can check the version of SharePoint as follows:

Get-SPFarm | Select BuildVersion

To list all site collection use the Get-SPOSite cmdlet.

sharepoint online management shell commands

Using the Get-Member cmdlet, you can define the properties and methods of any object. For example, using the following command you can see all the properties of the SPSite object:

Get-SPSite | Get-Member

To remove a site collection, use the Remove-SPOSite cmdlet

Remove-SPOSite -Identity theitbrostenant.sharepoint.com/sites/SiteCollectionName –NoWait

To create multiple sites from a CSV file in the following format:

Name,URL,Owner,StorageQuota,ResourceQuota,Template First Site,https://theitbrostenant.sharepoint.com/sites/site1,[email protected],1024,300,STS#0 Corporate Blog, https://theitbrostenant.sharepoint.com/sites/blog,[email protected],512,100,BLOG#0

Use the following script:

Import-Csv .\SitesToAdd.csv| % {New-SPOSite -Owner $_.Owner -StorageQuota $_.StorageQuota -Url $_.Url -NoWait -ResourceQuota $_.ResourceQuota -Template $_.Template -Title $_.Name}

Get the list of groups:

Get-SPOSite | ForEach-Object {Get-SPOSiteGroup -Site $_.Url} |Format-Table

Get a list of all users:

Get-SPOSite | ForEach-Object {Get-SPOUser -Site $_.Url}

Add new Site Collection administrator:

Set-SPOUser -Site {Corporate Blog} -LoginName [email protected] -IsSiteCollectionAdmin $true

To remove a user from the Site Collection Administrator group:

Remove-SPOUser -LoginName [email protected] -Site {Corporate Blog}

Available templates can be viewed with the command:

Get-SPWebTemplate

List of installed components:

Get-SPFeature -Limit ALL | Where-Object {$_.Scope -eq "SITE"}

List of available site templates:

Get-SPWebTemplate | where {$_.Title -match "business"}

List of running SharePoint services:

Get-Service | Where-Object {$_.DisplayName -like "Sharep*"}

Check the content database for errors:

Test-SPContentDatabase -name WSS_Content –webapplication http://blog
Cyril Kardashevsky

Cyril Kardashevsky

I enjoy technology and developing websites. Since 2012 I'm running a few of my own websites, and share useful content on gadgets, PC administration and website promotion.

Cyril Kardashevsky

Latest posts by Cyril Kardashevsky (see all)

Sours: https://theitbros.com/sharepoint-online-management-shell/

As a Microsoft 365 global or SharePoint admin for your organization, you can use the SharePoint Management Shell to manage users, sites, and site collections. The SharePoint Management Shell is a Windows PowerShell module that lets you run command-line operations. It makes performing batch operations more efficient, and is the only way to perform some management tasks in SharePoint and OneDrive.

Note: If you're new to Microsoft 365 or SharePoint, we recommend getting familiar with the SharePoint admin center first. To get started, see SharePoint planning guide.

Get started managing SharePoint using PowerShell cmdlets

  1. Download and install the latest SharePoint Management Shell. If you already have a previous version installed, uninstall it first and then install the latest version.

  2. Connect the SharePoint Management Shell to SharePoint for your organization. For info, see Connect the SharePoint PowerShell.

For a list of SharePoint PowerShell cmdlets you can run, see SharePoint PowerShell.

Sours: https://support.microsoft.com/en-us/office/introduction-to-the-sharepoint-management-shell-c16941c3-19b4-4710-8056-34c034493429
  1. Acts 14 study
  2. Long branch hotels
  3. Petsmart koi food
  4. Jim bottorff
  5. Stitch cup starbucks

Intro to SharePoint Online Management Shell

  • 2 minutes to read

The SharePoint Online Management Shell is a Windows PowerShell module that you can use to manage SharePoint settings at the organization level and site collection level. Command-line operations in Windows PowerShell are composed of a series of commands. Each command uses a cmdlet and a set of settings known as parameters. For example, you use the New-SPOSite cmdlet to create a new site collection with a specified title, URL, owner, storage quota, and template (the parameters).

SharePoint Online PowerShell commands can be very efficient for batch operations — for example, creating a dozen new site collections or adding hundreds of new users to a site. For more information, see Why you need to use Office 365 PowerShell.

Getting Started with SharePoint Online PowerShell

To use SharePoint Online PowerShell commands, you must have the SharePoint Admin role or Global Administrator role in Office 365.

You must install the SharePoint Online Management Shell module and connect to the SharePoint Online service. For more information, see Connect SharePoint Online.

What's the difference between SharePoint Online PowerShell commands and Office 365 PowerShell commands?

The major and obvious difference is the nouns they use. Every SharePoint Online cmdlet will start with SPO as its noun. Conversely, Office 365 will start with MSO as its noun.

SharePoint Online Management Shell commands manage SharePoint settings and site collections, whereas Office 365 commands manage Office 365-level tasks such as users, licenses, organization information, and services. They both manage users and groups. However, Office 365 PowerShell commands manage users and groups for all of the Office 365 services. The SharePoint Online commands manage users and groups only for SharePoint Online.

Should I use the SharePoint admin center or SharePoint Online PowerShell commands?

If you are new to Office 365 and SharePoint Online and you have not done much managing of SharePoint sites or users, the SharePoint admin center is a good place to start.

After you get familiar with SharePoint sites and users, try using SharePoint Online PowerShell commands, especially when you want to manage lots of site collections or users.

How do I get permissions and set up the environment?

To use SharePoint Online PowerShell commands, you must be a SharePoint admin in your organization. For info about installing the SharePoint Online Management Shell module and connecting to the SharePoint Online service, see Get started with SharePoint Online Management Shell

Sours: https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/introduction-sharepoint-online-management-shell
Getting started with SharePoint Online Management Shell

11

Howdy Folks! As promised in previous blog  post related to Office groups , I’m back now with some cool PowerShell cmdlets which should ease your work in managing Office 365 groups in your organization . If you’re new to Office 365 groups, I humbly request you to read in detail about Office 365 groups by accessing this link. I’ve tried my best to explain Office 365 groups there. You can read this post on HubFly blog site as well. Alright, let’s get started ….

Note : Before you can run all these PowerShell cmdlets below , you need to load the Exchange Online management shell by following this link .I’ve given a screenshot below for your reference .

1

Listed below are the operations that you can perform by following the PowerShell commands mentioned below

  • Get the list of all the Office 365 groups in your tenant
  • Remove an existing Office 365 group from the tenant
  • To make changes to an existing Office 365 group
  • Get the membership and ownership information of an Office 365 group /all the Office 365 groups in your tenant
  • Get the list of all the Office 365 groups in descending order
  • Get the list of all Private Office 365 groups in your tenant
  • Get the list of deleted Office 365 groups in descending order
  • Get the list of orphaned Office 365 groups in your tenant
  • Retrieve the list of recently created Office 365 groups
  • Update the quota of a new group if a team site exists
  • Create new Directory Settings for Groups template
  • Update the classifications for all the Office 365 groups
  • Update the privacy of an Office 365 group based on its classification
  • Determine where a group was provisioned (Planner, Yammer, Teams etc.)
  • Get the list of Obsolete Office 365 groups in your tenant

So, let’s look into all these operations in detail below….

  1. To get the list of all the Office 365 groups in your tenant:

Get-UnifiedGroup

2

  1. To remove an existing Office 365 group:

This will remove a specific Office 365 group from your tenant.

Remove-UnifiedGroup -Identity “Test Group”

  1. To make changes to an existing Office 365 group in your tenant:

Set-UnifiedGroup

Ex 1: Set-UnifiedGroup -Identity “HR Team” -AccessType Private

This example changes the Office 365 Group named HR Team from a public group to a private group.

Ex 2: Set-UnifiedGroup -Identity “HR Team” -PrimarySmtpAddress [email protected] -RequireSenderAuthenticationEnabled $false

This example makes the following changes to the Office 365 Group named HR Team:

i)The primary email address is changed to [email protected].

ii)The Office 365 Group is allowed to receive mail from unauthenticated (external) senders.

  1. To get the membership and ownership information of an Office 365 group/all the Office 365 groups in your tenant:

Get-UnifiedGroupLinks

Ex: Get-UnifiedGroupLinks -Identity “Transport Department” -LinkType Members

This example shows the members of the Office 365 Group named Transport Department

Similarly, you can use the script below to get the list of all the members from all the Office 365 groups in you tenant.

Get Office 365 group members

This will run and display the results as shown in the screenshot below.

3

  1. To get the list of all the Office 365 groups in descending order:

Get-UnifiedGroup | Select Id, DisplayName, ManagedBy, Alias, AccessType, WhenCreated, @{Expression={([array](Get-UnifiedGroupLinks -Identity $_.Id -LinkType Members)).Count }; Label=’Members’} | Sort-Object whencreated | Format-Table displayname, alias, managedby, Members, accesstype, whencreated

4.png

  1. To get the list of all private Office 365 groups in your tenant:

Get-UnifiedGroup | Where-Object {$_.AccessType -eq ‘Private’} | Sort-Object whencreated | Format-Table displayname, alias, managedby, accesstype, whencreated

5.png

  1. To get list of deleted Office 365 groups in descending order:

Get-AzureADMSDeletedGroup | Sort-Object DeletedDateTime -Descending | Format-Table Id, DisplayName, Description, Visibility, DeletedDateTime

Note: To run this command, you need to do the below mentioned steps, else you would end up getting an error as shown in the image below. If you pay close attention to the cmdlet you would notice that this is related to Azure AD and hence you need to load the Azure AD PowerShell module for this.

I’d suggest performing these tasks in a different PowerShell window for ease of use.

  1. Uninstall the production module of Azure AD by running, (Uninstall-Module AzureAD) as this cmdlet works with the preview module of Azure AD.
  2. You cannot have the production module and the preview module running on the same machine as per Microsoft’s documentation mentioned in this link https://docs.microsoft.com/en-us/powershell/azure/active-directory/install-adv2?view=azureadps-2.0
  3. Once done, please go ahead and install the Preview module by running (Install-module AzureADPreview)
  4. After that, please connect to Azure AD by running Connect-AzureAD as shown in the image below

12

5. Once you’re done connecting to Azure AD, please go ahead and run the above-mentioned cmdlet to get the list of deleted Office 365 groups in descending order and you will get the results as shown in the image below. In my case I don’t have any deleted Office 365 group and hence it didn’t return anything.

13

8.To get the list of orphaned Office 365 groups in your tenant:

$Groups = Get-UnifiedGroup | Where-Object {([array](Get-UnifiedGroupLinks -Identity $_.Id -LinkType Owners)).Count -eq 0} `

| Select Id, DisplayName, ManagedBy, WhenCreated

ForEach ($G in $Groups) {

Write-Host “Warning! The following group has no owner:” $G.DisplayName

}

14

9.To retrieve the list of recently created Office 365 groups:

# Variables:

#   Cutoff date in days

#   Storage quota in MB

#   Storage quota warning level in MB

#………………………………………………………………………………………………………………………………………

$cutoffdate = ((Get-Date).AddDays(-20))

$quota = 500

$warning = 400

$Groups = Get-UnifiedGroup | Where-Object {$_.WhenCreated -ge $cutoffdate} | Sort-Object whencreated | Select DisplayName, WhenCreated, SharePointSiteUrl

15.png

  1. To update the quota of a new group accordingly if a team site exists:

ForEach ($G in $Groups) {

try

{

Set-SPOSite –Identity ($G.SharePointSiteUrl) -StorageQuota $quota -StorageQuotaWarningLevel $warning

Write-Host “The following site quota was updated:” $G.SharePointSiteUrl

}

catch

{

Write-Host “The following Groups does have a site:” $G.DisplayName

}

}

 

This will run and update the quota of the site as shown in the screenshot below.

16

11.To create new Directory Settings for Groups template:

There are multiple templates that are part of your Azure AD tenant.  This template can contain a settings object which has a collection of values.  By using these values, we can set the parameters below.  This needs to be done before you can set any values

SettingDescription
·         EnableGroupCreation

·         Type: Boolean

·         Default: True

The flag indicating whether Office 365 group creation is allowed in the directory by non-admin users. This setting does not require an Azure Active Directory Premium P1 license.
·         GroupCreationAllowedGroupId

·         Type: String

·         Default: “”

GUID of the security group for which the members are allowed to create Office 365 groups even when EnableGroupCreation == false.
·         UsageGuidelinesUrl

·         Type: String

·         Default: “”

A link to the Group Usage Guidelines.
·         ClassificationDescriptions

·         Type: String

·         Default: “”

A comma-delimited list of classification descriptions.
·         DefaultClassification

·         Type: String

·         Default: “”

The classification that is to be used as the default classification for a group if none was specified.
·         PrefixSuffixNamingRequirement

·         Type: String

·         Default: “”

String of a maximum length of 64 characters that defines the naming convention configured for Office 365 groups. For more information, see Enforce a naming policy for Office 365 groups (preview).
·         CustomBlockedWordsList

·         Type: String

·         Default: “”

Comma-separated string of phrases that users will not be permitted to use in group names or aliases. For more information, see Enforce a naming policy for Office 365 groups (preview).
·         EnableMSStandardBlockedWords

·         Type: Boolean

·         Default: “False”

Do not use
·         AllowGuestsToBeGroupOwner

·         Type: Boolean

·         Default: False

Boolean indicating whether or not a guest user can be an owner of groups.
·         AllowGuestsToAccessGroups

·         Type: Boolean

·         Default: True

Boolean indicating whether or not a guest user can have access to Office 365 groups content. This setting does not require an Azure Active Directory Premium P1 license.
·         GuestUsageGuidelinesUrl

·         Type: String

·         Default: “”

The URL of a link to the guest usage guidelines.
·         AllowToAddGuests

·         Type: Boolean

·         Default: True

A Boolean indicating whether or not is allowed to add guests to this directory.
·         ClassificationList

·         Type: String

·         Default: “”

A comma-delimited list of valid classification values that can be applied

Let me walk you through the complete process of creating directory settings here.

  1. Install the Azure AD PowerShell Module V2 from this link
  2. Run “Install-Module -Name AzureADPreview” in the PowerShell window
  3. Once done Connect to Azure AD via PowerShell by running “Connect-AzureAD”
  4. Once done to review if you have any settings already configured in your tenant, please run the below cmdlet.

 Get-AzureADDirectorySetting | ForEach Values

17

Note: If you check the screenshot above you will notice that I have configured few directory settings such as “Usage Guidelines URL “and “Classification List “and I’ll be showing you how to configure that using PowerShell in the examples below.

5. If you do not have any settings configured the value returned will be blank as show in the screenshot below.

18

6. Alright, now let’s see some examples to set group settings.

7. All examples below will use the Get-AzureADDirectorySetting cmdlet and store that in a variable and then use the Set-AzureADDirectorySetting cmdlet with the updated settings. The full command to run a setting update is as follows. Also, I’d suggest to use PowerShell ISE for running these cmdlets for ease of usage.

$settings = Get-AzureADDirectorySetting | where-object {$_.displayname -eq “Group.Unified”}

$settings[“SETTING NAME”] = “”

Set-AzureADDirectorySetting -Id $settings.Id -DirectorySetting $settings

19.pngOk, now let’s look into some scenarios here …

Scenario 1:  Restricting Office 365 groups creation for all the users in your organization except for few users who belong to a specific Security group

$group = Get-AzureADGroup -All $True | Where-Object {$_.DisplayName -eq “Office 365 groups creation allowed”}

$settings = Get-AzureADDirectorySetting | where-object {$_.displayname -eq “Group.Unified”}

$settings[“EnableGroupCreation”] = “false”

$settings[“GroupCreationAllowedGroupId”] = $group.ObjectId

Set-AzureADDirectorySetting -Id $settings.Id -DirectorySetting $settings

20In this scenario here, I created a security group named “Office 365 groups creation allowed” and I’ve added few members to it. So, by doing this I can grant access only to those members to create Office 365 groups and not to all the users in my organization. Also, an important point to bear in mind here is, if I’m restricting the creation of Office 365 groups then these users won’t be able to create a Team, a Planner, a Yammer group etc. So, the users will be restricted by creating anything which creates an Office 365 group in the backend. So, from an end user perspective, the “create” button which you see in the screenshot below for creating Office 365 groups won’t be visible to them. The same applies for other services also, users won’t get the “Create Planner “or “Create Team” button once this option is enabled. This is one way to have control on Office 365 groups creation in your organization

6.png

In Teams, the “Create a Team “button won’t be visible for the users who are not part of that Security group which allows the creation of Office 365 groups.

7.png

In Planner, the “Create a Plan “button won’t be visible for the users who are not part of that Security group which allows the creation of Office 365 groups.

8

Similarly , as already explained above other services which creates an Office 365 group on the backend won’t be available for end users . By doing this you can have control over who gets to create an Office 365 groups and other services such as Teams and Planner in your organization .

Scenario 2: Setting Office 365 groups classification

$settings = Get-AzureADDirectorySetting | where-object {$_.displayname -eq “Group.Unified”}

$settings[“ClassificationList”] = “Internal,External,Confidential”

Set-AzureADDirectorySetting -Id $settings.Id -DirectorySetting $settings

In this scenario, we’re enabling the classification option so that you can classify your groups accordingly. Once this is done whenever you try to create an Office 365 group from the outlook webmail (provided that you have access to create Office 365 groups) you will get an option to choose the classification for that group also as shown in the image below. This could be useful from a compliance and governance perspective.

9.png

Once that’s done you can set the classification for an existing Office 365 by running the below PowerShell command.

Set-UnifiedGroup <[email protected]> -Classification <Internal>

Also, if you want to create a new group with a classification then run the below PowerShell command for that.

New-UnifiedGroup <[email protected]> -Classification <External> -AccessType <Public>

Scenario 3:  Setting Usage Guidelines URL

$settings = Get-AzureADDirectorySetting | where-object {$_.displayname -eq “Group.Unified”}

$setting[“UsageGuidelinesUrl”] = “<https://o365techy.sharepoint.com/sites/office365groupsgovernance/usageguidelines/SitePages/Home.aspx>&#8221;

Set-AzureADDirectorySetting -Id $settings.Id -DirectorySetting $settings

21

In this scenario, I’ve created a SharePoint subsite named “Usage Guidelines” which speaks about all the guidelines a user must follow while using Office 365 groups in my organization and the user can refer that while creating / using Office 365 groups. Once this has been enabled this what the end user view would be like. Please check the screenshot below.

10

Scenario 4: Restrict all access for guest users to Groups including the ones that were already granted access

$settings = Get-AzureADDirectorySetting | where-object {$_.displayname -eq “Group.Unified”}

$settings[“AllowGuestsToAccessGroups”] = “False”

Set-AzureADDirectorySetting -Id $settings.Id -DirectorySetting $settings

22Scenario 5: Restrict the ability to add any new guest users but do not restrict existing guest users

$settings = Get-AzureADDirectorySetting | where-object {$_.displayname -eq “Group.Unified”}

$settings[“AllowToAddGuests”] = “False”

$settings[“AllowGuestsToAccessGroups”] = “True”

Set-AzureADDirectorySetting -Id $settings.Id -DirectorySetting $settings

23Finally, if you want to review all the updated settings then please run the below mentioned PowerShell cmdlet as already described above and it will return the updated settings.

Get-AzureADDirectorySetting | ForEach Values

24

If you want to remove the group settings that we configured in all the scenarios above then please run the below PowerShell command.

$settings = Get-AzureADDirectorySetting | where-object {$_.displayname -eq “Group.Unified”}

Remove-AzureADDirectorySetting -Id$settings.Id

25.png12.To update the classifications for all the Office 365 groups:

## Set classifications for all groups

$Groups = Get-UnifiedGroup | Where-Object {$_.Classification -Eq $Null}  | Select DisplayName, Classification

ForEach ($G in $Groups) {

If ($G.Classification -Eq $Null)

{

Write-Host $G.DisplayName

Set-UnifiedGroup -Identity $G.DisplayName -Classification “Internal”

}

}

 

#……………………………..

# Variables:

#   Cut off date in days

#   Classification

#……………………………..

$cutoffdate = ((Get-Date).AddDays(-10))

$classification = “High”

# Retrieve recently created groups with accesstype set to PUBLIC

$Groups = Get-UnifiedGroup | Where-Object {

$_.WhenCreated -ge $cutoffdate -and $_.AccessType -eq ‘Public’ -and $_.Classification -eq $classification } `

| Sort-Object whencreated | Select DisplayName, WhenCreated, AccessType, Classification, ManagedBy

# For each new group update set accesstype to PRIVATE

ForEach ($G in $Groups) {

Set-UnifiedGroup -Identity $G.DisplayName -AccessType ‘Private’

Write-Host “The following Group privacy setting was updated:” $G.DisplayName

}

26This will run and update the classification for all the Office 365 groups as shown in the image below

27

  1. To update the privacy of an Office 365 group based on its classification:

#……………………………..

# Variables:

#   Cutoff date in days

#   Classification

#……………………………..

$cutoffdate = ((Get-Date).AddDays(-10))

$classification = “High”

# Retrieve recently created groups with accesstype set to PUBLIC

$Groups = Get-UnifiedGroup | Where-Object {

$_.WhenCreated -ge $cutoffdate -and $_.AccessType -eq ‘Public’ -and $_.Classification -eq $classification } `

| Sort-Object whencreated | Select DisplayName, WhenCreated, AccessType, Classification, ManagedBy

# For each new group update set accesstype to PRIVATE

ForEach ($G in $Groups) {

Set-UnifiedGroup -Identity $G.DisplayName -AccessType ‘Private’

Write-Host “The following Group privacy setting was updated:” $G.DisplayName

}

30.png

31.png

14.To determine where a group was provisioned (Planner, Yammer, Teams etc.)

To get the list of Yammer integrated Office 365 group list:

Get-UnifiedGroup |Where-Object {$_.ProvisioningOption -eq ‘YammerProvisioning’} |select DisplayName,Alias,ProvisioningOption,GroupSKU,SharePointSiteUrl,SharePointDocumentsUrl,AccessType

To get the list of Teams integrated Office 365 group list:

Get-UnifiedGroup |Where-Object {$_.ProvisioningOption -eq ‘ExchangeProvisioningFlags:481’}|select DisplayName,Alias,ProvisioningOption,GroupSKU,SharePointSiteUrl,SharePointDocumentsUrl,AccessType

Similarly, we expect MSFT to work on for Planner and other services which create an Office 365 on the backend.

15.To get the list of Obsolete Office 365 groups in your tenant:

This is a PowerShell script from Office 365 fame Tony Redmond and the explanation for the script can be found below.

Note : You need to be connected to Exchange Online PowerShell module as well as the SharePoint Online PowerShell module to run this script

Like any object, an Office 365 Group might become unused over time. No current method exists to detect what groups are underused, so here’s a script that does the job for you by checking audit records to establish whether any SharePoint file activity has occurred in the group document library in the last 90 days and whether any conversations have happened in the group mailbox in the last year. Seeing that it’s all done in simple PowerShell, you can tailor the code to your heart’s content. A HTML report file is generated at the end, which contains some statistics like:

32.jpg

Number of groups scanned: 155

Number of potentially obsolete groups (based on document library activity): 132

Number of potentially obsolete groups (based on conversation activity): 60

Number of Teams-enabled groups: 41

Percentage of Teams-enabled groups: 26.45%

Script:

Check for obsolete Office 365 groups

Thanks for reading this post …. Good luck with Office 365 groups!!!!

Like this:

LikeLoading...

Sours: https://vigneshsharepointthoughts.com/tag/powershell-sharepoint-online/

Commands sharepoint shell online management

Get started with SharePoint Online Management Shell

  • 2 minutes to read

To get started using PowerShell to manage SharePoint Online, you need to install the SharePoint Online Management Shell and connect to SharePoint Online.

Install the SharePoint Online Management Shell by downloading and running the SharePoint Online Management Shell or installing the module from the PowerShell Gallery. Once installed, the module is available for use, and you do not need to install it again until you need features introduced in a later version. For example, you may need to install a new version for TLS 1.2 negotiation after October 2018.

First you can check if you have already installed the SharePoint Online Management Shell by running the following command in administrative mode in PowerShell:

If your operating system is using PowerShell 5 or newer, you can also install the SharePoint Online Management Shell by running the following command in administrative mode:

If you don't have administrative privileges on the system, you can install the SharePoint Online Management Shell only for the current user by running the following command:

To ensure you have all available cmdlets, you should always make sure the module is up to date. You can update the SharePoint Online Management Shell by running the following command in administrative mode:

To open the SharePoint Online Management Shell command prompt, from the Start screen, type sharepoint, and then click SharePoint Online Management Shell.

To connect with a user name and password

  1. Run the following command at the SharePoint Online Management Shell command prompt:

  2. When prompted with the Windows PowerShell credential request dialog box, type the password for the SharePoint admin account.

To assign a user the SharePoint admin role, see Assign admin roles or Assign admin roles to Microsoft 365 user accounts with PowerShell.

To connect with multifactor authentication (MFA)

  1. Run the following command at the SharePoint Online Management Shell command prompt:

  2. When prompted with the Microsoft SharePoint Online Management Shell dialog box, type the account name and password for a SharePoint administrator account, and then click Sign in.

  3. Follow the instructions in the Microsoft SharePoint Online Management Shell dialog box to provide the additional authentication information, such as a verification code, and then click Sign in.

You are now ready to use SharePoint Online commands.

Sours: https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/connect-sharepoint-online
010 Introduction - PowerShell with SharePoint from Scratch
SharePoint Online PowerShell Module in PowerShell Gallery

SharePoint Online PowerShell Module Helps Automate Common Tasks

The SharePoint Online Management Shell is a Windows PowerShell module designed for command-line operations and inclusion in PowerShell scripts. The module makes it possible to perform batch processing for tasks like reports and is the only way to achieve some management tasks in SharePoint and OneDrive.

Like with many other cloud components, Microsoft updates the SharePoint Online Management Shell almost every month to align with the release cadence of the SharePoint Client-Side Object Model (CSOM) API libraries. The updates include new cmdlets, new parameters for cmdlets, and other tweaks. If you use PowerShell to work with SharePoint Online, it’s important that you use the latest module.

Installing the Latest SharePoint Online Module

You can download an MSI (installable package) for the latest SharePoint Online Management Shell module. Once downloaded, you run the executable to install the module, remembering to uninstall any previous version first. The MSI version is the traditional method to distribute updated modules, but since Microsoft released the Microsoft.Online.SharePoint.PowerShell module in the PowerShell Gallery, it’s more convenient to install it from there.

To install the SharePoint Online module, run PowerShell as an administrator and run this command:

Install-Module -Name Microsoft.Online.SharePoint.PowerShell

To update to the latest version, run:

Update-Module -Name Microsoft.Online.SharePoint.PowerShell

Connecting to SharePoint Online with PowerShell

The Connect-SPOService cmdlet is used to connect to the SharePoint administration endpoint for a tenant. (the same as used for the SharePoint Admin Center) To build the endpoint, take the normal SharePoint root for your tenant (like https://office365itpros.sharepoint.com/) and insert an “-admin” after the tenant name. For example:

# Connect to SharePoint Online administration endpoint Connect-SPOService -URL "https://office365itpros-admin.sharepoint.com"

The SharePoint Online module is designed for administrative tasks, so you should always connect with an account that has Global Administrator or SharePoint Administrator rights for the tenant.

As part of the connection to the administration endpoint, the SharePoint Online module is loaded into your PowerShell session and you can check the version of the installed module installed:

Get-Module |? {$_.Name -eq "Microsoft.Online.SharePoint.PowerShell"}| Format-Table Name, Version Name Version ---- ------- Microsoft.Online.Sharepoint.PowerShell 16.0.19724.12000

In your scripts, it’s a good idea to include a test to make sure that a connection is available to SharePoint Online before running any other code. Here’s a very simple test for a connection:

Try { $TestSPO = Get-SPOTenant } Catch { Write-Host "Error accessing SharePoint Online - please connect to the service before retrying"; break }

Basic SharePoint PowerShell Cmdlets

To see the available SharePoint Online cmdlets, run:

Get-Command -Module "Microsoft.Online.SharePoint.PowerShell"

The current SharePoint Online Management Shell module includes 179 cmdlets. Theses cmdlets can be divided into several types, including:

  • Tenant-Level cmdlets like Get-SPOTenant and Set-SPOTenant.
  • Site-Level cmdlets like Get-SPOSite and Set-SPOSite.
  • Cmdlets for specific operations like Start-SPOSiteRename and Test-SPOSite.

It’s very common to want to retrieve information about the sites in a tenant. To do this, run the Get-SPOSite cmdlet. The Limit parameter specifies that all sites are to be returned.

Get-SPOSite -Limit All

Note that this command returns all types of sites found in the tenant, including redirect sites (created because of site URL renames), hub sites, the app catalog, and sites used by Teams private channels. In most cases, it is best to be more precise when using Get-SPOSite to find sites by specifying the template for the type of sites you want to process. For instance, this command only returns the sites used by Teams private channels.

Get-SPOSite -Limit All -Template "TEAMCHANNEL#0"

SharePoint and Other Office 365 Elements

Sometimes you need to retrieve information about a SharePoint Online site for use elsewhere inside Office 365. For example, if you want to include a document library belonging to an Office 365 group, team, or team private channel on an eDiscovery case or content search, you need to specify the site’s URL as a search location.

If you use PowerShell to examine the properties of an Office 365 group, you will see three SharePoint Online URLs returned for the site, the document library, and the shared OneNote notebook. The value returned in SharePointSiteUrl property is the one needed when you wish to add a site to content searches, found using the Get-UnifiedGroup PowerShell cmdlet:

Get-UnifiedGroup –Identity "Office 365 for IT Pros" | Format-List Share*Url SharePointSiteUrl : https://Office365ITPros.sharepoint.com/sites/O365ITPros SharePointDocumentsUrl : https://Office365ITPros.sharepoint.com/sites/O365ITPros/Shared Documents SharePointNotebookUrl : https://Office365ITPros.sharepoint.com/sites/O365ITPros/SiteAssets/Office 365 for IT Pros Notebook

The URL retrieved from the Office 365 Group can be used with Get-SPOSite to find further information about the site belonging to the group.

It’s also possible to discover what Office 365 Group a site belongs to by using the GroupId property stored for the site. For example:

Get-UnifiedGroup -Identity (Get-SPOSite -id https://office365itpros.sharepoint.com/sites/O365ExchPro).GroupId.Guid | Format-Table DisplayName, SharePointSiteURL DisplayName SharePointSiteUrl ----------- ----------------- Office 365 for IT Pros https://office365itpros.sharepoint.com/sites/O365ITPros

SharePoint PnP Module

The functionality available through the SharePoint Online PowerShell module is limited and restricted to basic administration tasks performed by a SharePoint Online administrator, such as managing sites and tenant settings. To get extra functionality, use the cmdlets available in the SharePoint PnP PowerShell cmdlets project in GitHub, part of the Patterns & Practices community initiative. To go further and be able to access all the aspects of SharePoint, you will need to use the CSOM API in your PowerShell scripts. To install the PnP PowerShell module, run this command:

Install-Module SharePointPnPPowerShellOnline -Force

Many good examples of using the SharePoint PnP cmdlets are available on the web.


This information is an example of the kind of text you’ll find in the Office 365 for IT Pros eBook. Don’t you think you should be a subscriber?

Like this:

LikeLoading...

Related

Sours: https://office365itpros.com/2020/02/21/managing-sharepoint-online-with-powershell/

Now discussing:

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-SPOTenantRename

Important

  • This feature is available only for customers who have been accepted into the Private Preview program. Request to join the Private Preview. Note that submitting a nomination does not guarantee acceptance into the program. We review the nominations on a case-by-case basis and will contact you if you're accepted.
  • This feature is not available for organizations that have set up multi-geo.

Starts a job to change the SharePoint domain name for your organization in Microsoft 365. For example, if the name of your organization changes from "Contoso" to "Fabrikam," you can change contoso.sharepoint.com to fabrikam.sharepoint.com.

Warning

Changing your SharePoint domain name might take several hours to days depending on the number of sites and OneDrive users that you have. We strongly recommend that you make this change during a period of low usage (like a weekend) and tell users to avoid accessing SharePoint and OneDrive content during the change. In addition, any actions that create new OneDrives and sites (such as creating a new team or private channel in Microsoft Teams) will be temporarily blocked during the rename.

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-SPOTenantRename

Important

  • This feature is available only for customers who have been accepted into the Private Preview program. Request to join the Private Preview. Note that submitting a nomination does not guarantee acceptance into the program. We review the nominations on a case-by-case basis and will contact you if you're accepted.
  • This feature is not available for organizations that have set up multi-geo.

Cancels the scheduled job to change the SharePoint domain name for your organization in Microsoft 365.

Note

If the job to change the SharePoint domain name is already in progress, then it cannot be canceled or stopped.

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.

Sours: https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/


972 973 974 975 976