Share via


SharePoint Server SPOMod: Connect-SPCSOM

This article describes a function of a custom SharePoint module available for download and installation on GitHub where it welcomes all your suggestions and contributions.

Connect-SPCSOM

The cmdlet connects you to a particular subsite or site collection on a SharePoint Server 2013 or 2016 where you want to perform other cmdlets (move items, create lists, change settings, etc.). It is necessary to run this cmdlet before other cmdlets. If you do not connect, other cmdlets will return an error or empty results.
The cmdlet is applicable for SharePoint Server. If you are interested for the same function in SharePoint Online, please refer to Connect-SPOCSOM.

Parameters

 Parameter Name    Description
 Url        
   
The URL of a site collection, e.g. https://sp.company.com/sites/SampleSitecollection 
 Username   The login name of a user, e.g. Administrator

Example

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

Connect-SPCSOM -Username Administrator -Url   https://sp.company.com/sites/SampleSitecollection

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

$username=Administrator
$url="https://sp.company.com/sites/SampleSitecollection"
Connect-SPOCSOM -Username $username -Url $url

See Also