Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Connect-SPOService

Connect-SPOService

microsoft.online.sharepoint.powershell.dll, microsoft.online.sharepoint.powershell-1.dll

Synopsis

Connects a SharePoint Online 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.

Syntax

Connect-SPOService [-Url] [-Credential] [<CommonParameters>]

Detailed Description

The Connect-SPOService cmdlet connects a SharePoint Online global administrator to the SharePoint Online Administration Center.

Only a single SharePoint Online service connection is maintained from any single Windows PowerShell session. In other words, this is a per-organization administrator connection. Running the Connect-SPOService cmdlet twice implicitly disconnects the previous connection. The Windows PowerShell session will be set to serve the new SharePoint Online global administrator specified.

A delegated partner administrator has to swap connections for different organizations within the same Windows PowerShell session.

You must be a SharePoint Online global administrator to run the cmdlet.

For permissions and the most current information about Windows PowerShell for SharePoint Online, see the online documentation at http://go.microsoft.com/fwlink/p/?LinkId=251832 (http://go.microsoft.com/fwlink/p/?LinkId=251832).

Parameters

-Url <UrlCmdletPipeBind>

Specifies the URL of the SharePoint Online Administration Center site.

Aliases

None

Required?

True

Position

1

Default value

Accept pipeline input?

True

Accept wildcard characters?

False

-Credential <CredentialCmdletPipeBind>

Specifies the credentials to use to connect. If no credentials are presented, a dialog will prompt for the credentials. The credentials must be those of a SharePoint Online global administrator who can access the SharePoint Online Administration Center site.

Aliases

None

Required?

False

Position

2

Default value

Accept pipeline input?

True

Accept wildcard characters?

False

Input Type

Return Type

Notes

None

Examples

--------EXAMPLE 1--------

Example 1 shows how a SharePoint Online global administrator with credential admin@contoso.com connects to a SharePoint Online Administration Center that has the URL http://contoso-admin.sharepoint.com/.

C:\PS>Connect-SPOService -Url https://contoso-admin.sharepoint.com -credential admin@contoso.com

--------EXAMPLE 2--------

Example 2 shows how a SharePoint Online global administrator with a user name and password connects to a SharePoint Online Administration Center that has the URL http://contoso-admin.sharepoint.com/.

C:\PS>$username = "admin@contoso.sharepoint.com"
$password = "password"
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(convertto-securestring $Password -asplaintext -force)

Connect-SPOService -Url http://contoso-admin.sharepoint.com/ -Credential $cred

Introduction to the SharePoint Online management shell
Set up the SharePoint Online Management Shell Windows PowerShell environment
Disconnect-SPOService