SharePoint online which is a subset of Office 365 has come up with SharePoint Online Management Shell to run administrative commands from the command line. These cmdlets will help manage SharePoint Online users and sites. SharePoint Online Management Shell is a Windows PowerShell module.
NOTE: To use cmdlets, a SharePoint Online site administrator must be a global administrator in Office 365.
SharePoint Online Management Shell can only be used by the SharePoint Online global administrators. This tool is helpful to remotely manage site collections, configure SharePoint Online company-level settings, upgrade site collections to a new version and get logs from data connections between SharePoint Online and other services through Business Connectivity Services
First of all, you have to set up the environment for SharePoint Online Management Shell.
Set up SharePoint Online Management Shell environment
Please follow these below mentioned steps to set up the SharePoint Online Management Shell environment.
Please download and install Windows Management Framework 3.0 from here https://www.microsoft.com/en-us/download/details.aspx?id=34595
Note: Based on your environment, this installation may get failed. So, just skip this installation error message if this installation is not suitable for your environment.
Please download and install SharePoint Online Management Shell from here https://www.microsoft.com/en-us/download/details.aspx?id=35588
After successful installation, please open this app/tool from your installed gallery. You may pin it to task bar for use it in future.
Please run this as “Run ISE as Administrator”.
Get-Help Section of Cmdlets
Now, please refer this screenshot, here first I am trying to get-help more about the command Connect-SPOService through this PS window. It has intelligence which would help you to locate the exact command you want to execute.
NOTE: You can use the Get-Command cmdlet to list all cmdlets, and use the Get-Help cmdlet to learn more about any cmdlet. For more information, see Get-Command and Get-Help.
Here I have used to Get-Help cmdlet for Connect-SPOService
For getting more help information of a particular cmdlet, you can use these below mentioned cmdlets.
To see the examples, type: “Get-Help Connect-SPOService -examples”.
For more information, type: “Get-Help Connect-SPOService -detailed”.
For technical information, type: “Get-Help Connect-SPOService -full”.
For online help, type: “Get-Help Connect-SPOService -online”
Get-Help Connect-SPOService –examples
Get-Help Connect-SPOService –full
Get-Help Connect-SPOService – detailed
Here I have taken Connect-SPOService as an example. You can use the Get-Help command for any of the cmdlets presents for SharePoint online.
Note: From these above mentioned help commands, you can get proper information about the syntax of the cmdlet, examples on how you can build your command and which parameters are required to execute a particular cmdlet.
Now, I will show you have we can execute the actual Connect-SPOService cmdlet.
For example, type this command at the prompt:
Connect-SPOService -Url https:// softreeconsulting-admin.sharepoint.com -credential firstname.lastname@example.org
URL is the URL of the SharePoint Online Administration Center
Credential is the user name to which you want to grant access to the SharePoint Online Administration Center site.
SharePoint Online Management Shell Cmdlets
There are many SharePoint online cmdlets are available. In this following section I have separated the cmdlets into mainly six categories and they are as mentioned below.
- User management cmdlets
- User group manangement cmdlets
- Upgrade cmdlets
- Site Collection management cmdlets
- Service connection and disconnection cmdlets
- Organisation-level monitoring and management cmdlets
- OneDrive sync for domains that are on the safe recipients list
- SharePoint Online and OneDrive Migration
User Management cmdlets
Cmdlet Name– Add-SPOuser
Description – Adds an existing Office 365 user or an Office 365 security group to a SharePoint group.
Add-SPOUser -Site https:// softreeconsulting.sharepoint.com -LoginName email@example.com -Group “SoftreeConsulting Owners”
Cmdlet Name– Get-SPOUser
Descriptions– This returns the SharePoint Online user or security group accounts that match a given search criteria.
Get-SPOUser -Site https://softreeconsulting.sharepoint.com
This returns all user or security group accounts from the site collection http://softreeconsulting.sharepoint.com.
Get-SPOUser -Site https://softreeconsulting.sharepoint.com -LoginName firstname.lastname@example.org
This returns one user or security group account whose user name is HYPERLINK “mailto:email@example.com” firstname.lastname@example.org from the site collection https://softreeconsulting.sharepoint.com.
Get-SPOUser -Site https://softreeconsulting.sharepoint.com -Group “Team Site Members”
This returns one user or security group account inside group Team Site Members from the site collection http://softreeconsulting.sharepoint.com.
Here in this below tables, I have added all respective cmdlets available for all categories.
User Management cmdlets
|User Management cmdlets Name||Description|
|Add-SPOuser||Adds an existing Office 365 user or an Office 365 security group to a SharePoint group.|
|Get-SPOUser||Returns the SharePoint Online user or security group accounts that match a given search criteria.|
|Remove-SPOUser||Removes a user or a security group from a site collection or a group.|
|Set-SPOUser||Configures properties on an existing user|
|Get-SPOExternalUser||Returns external users that are located in the tenant’s folder based on specified criteria|
|Remove-SPOExternalUser||Permanently removes a collection of external users from the tenant’s folder|
|Revoke-SPOUserSession||Provides IT administrators the ability to sign out and invalidate a particular users’ sessions across all their devices|
User Group management cmdlets:
|User group management cmdlets||Descriptions|
|Get-SPOSiteGroup||Gets all the groups on the specified site collection|
|New-SPOSiteGroup||Creates a new group in a SharePoint Online site collection|
|Remove-SPOSiteGroup||Removes a SharePoint Online group from a site collection|
|Set-SPOSiteGroup||Updates the SharePoint Online owner and permission levels on a group inside a site collection|
|Upgrade-SPOSite||Starts the upgrade process on a site collection.|
|Request-SPOUpgradeEvaluationSite||Requests creation of a copy of an existing site collection for the purposes of validating the effects of upgrade without affecting the original site|
Site Collection management cmdlets
|Site Collection management cmdlets||Descriptions|
|Get-SPODeletedSite||Returns all deleted site collections from the Recycle Bin|
|Remove-SPODeletedSite||Removes a SharePoint Online deleted site collection from the Recycle Bin.|
|Restore-SPODeletedSite||Restores a SharePoint Online deleted site collection from the Recycle Bin.|
|Get-SPOSite||Returns one or more site collections.|
|New-SPOSite||Creates a new SharePoint Online site collection for the current company.|
|Remove-SPOSite||Sends a SharePoint Online site collection to the SharePoint Online Recycle Bin.|
|Repair-SPOSite||Checks and repairs the site collection and its contents.|
|Set-SPOSite||Sets or updates one or more properties’ values for a site collection.|
|Test-SPOSite||Tests a SharePoint Online site collection.|
|Request-SPOPersonalSite||Requests that one or more users be added to the queue for a Personal Site to be created|
Service connection and disconnection cmdlets
|Service connection and disconnection cmdlets||Descriptions|
|Connect-SPOService||Connects a SharePoint Online global administrator to a SharePoint Online connection; that is, connects the administrator to the SharePoint Online Administration Center.
This cmdlet must be run before any other SharePoint Online cmdlets can run.
|Disconnect-SPOService||Disconnects from a SharePoint Online service.|
Organization-level monitoring and management cmdlets
|Organization-level monitoring and management cmdlets||Descriptions|
|Get-SPOAppErrors||Returns application errors.|
|Get-SPOAppInfo||Returns all installed applications.|
|Get-SPOTenant||Returns SharePoint Online organization properties.|
|Set-SPOTenant||Sets properties on the SharePoint Online organization.|
|Get-SPOTenantLogEntry||Retrieves SharePoint Online company logs.|
|Get-SPOTenantLogLastAvailableTimeInUtc||Returns the time when the SharePoint Online organization logs are collected.|
|Get-SPOWebTemplate||Displays all site templates that match the given identity.|
OneDrive sync for domains that are on the safe
|OneDrive sync for domains that are on the safe||Descriptions|
|Get-SPOTenantSyncClientRestriction||Returns the current configuration status|
|Remove-SPOTenantSyncClientRestriction||Disables the feature for tenancy, but does not remove any present domain GUID entries from the safe sender recipient list.|
|Set-SPOTenantSyncClientRestriction||Enables the feature for the tenancy and permits you to set the domain GUIDs in safe recipients list.|
SharePoint online and OndDrive Migration
|SharePoint online and OndDrive Migration||Description|
|ConvertTo-SPOMigrationTargetedPackage||Re-maps a previously created file share based package or exported SharePoint package to accurately describe objects in a target web.|
|New-SPOMigrationPackage||Creates a new migration package based on source files in a local or network shared folder.|
|Set-SPOMigrationPackageAzureSource||Creates Azure containers, upload migration package files into the appropriate containers, and snapshot the uploaded content.|
|Submit-SPOMigrationJob||Submits a new migration job referenced to a previously uploaded package in Azure Blob storage into to a site collection. .|
|Remove-SPOMigrationJob||Removes a previously created migration job from the specified site collection.|
|Get-SPOMigrationJobProgress||Reports on SPO migration jobs that are in progress.|
|Get-SPOMigrationJobStatus||Monitors the status of a submitted SharePoint Online Migration job.|
Hope this article helps you in learning SharePoint online management shell.
This solution is brought to you by our SharePoint professionals…
Softree Technology employs SharePoint consultants, who are experienced in writing for a multiplicity of SharePoint verticals including technical, promotional, creative, branding content, cataloguing and ethical media comprising journalism.
With more than 10 years of industry experience these professionals have the best resources to deliver optimum results. They have been satisfying customers with some of the best SharePoint Strategies. In case you need experts for Offshore development for SharePoint 2016, we have got you covered.