Get-SPOContext

Synopsis

Gets a SharePointOnline Context.

Syntax

Get-SPOContext [-SiteUrl] <String> [-UserName] <String> [-Password] <String> [<CommonParameters>]

Description

Returns a ClientContext object for a Site Collection. The object has references to the site $ctx.Site and the web $ctx.Web. Multiple contexts can be assigned to variables and used to move data between site collections or even tenants.

Parameters

-SiteUrl <String>

Required? True
Position? 0
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-UserName <String>

Required? True
Position? 1
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-Password <String>

Required? True
Position? 2
Default value  
Accept pipeline input? false
Accept wildcard characters? False

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

Outputs

Notes

Examples

Get a Context

PS C:\> $ctx = Get-SPOContext "https://somesite.sharepoint.com" "user@somesite.onmicrosoft.com" "PASSWORD1LOL"

Related links

Last edited Aug 5, 2014 at 12:06 AM by provokesolutions, version 9

Comments

No comments yet.