Skip to content

PowerShell Migration Guide: SP → CS Cmdlets

This guide helps you migrate from SharePoint Server PowerShell (SP cmdlets) to Cesivi PowerShell (CS cmdlets).

Quick Start

Module Loading

SharePoint Server:

Add-PSSnapin Microsoft.SharePoint.PowerShell

Cesivi:

Import-Module Cesivi.PowerShell

Connection

SharePoint Server:

# Runs on SharePoint server, connects directly to database
Get-SPSite http://sharepoint.local/sites/team

Cesivi:

# Connects via REST API to Cesivi Server
Get-CSSite -Identity "/sites/team" -ServerUrl "http://cesivi.example.com"

Cmdlet Mapping

Site Management

SharePoint Server Cesivi Notes
Get-SPSite Get-CSSite Identical parameters
New-SPSite New-CSSite Simplified parameters
Remove-SPSite Remove-CSSite Identical
Set-SPSite Set-CSSite Subset of SP parameters

Example Migration:

# SharePoint Server
Add-PSSnapin Microsoft.SharePoint.PowerShell
$site = Get-SPSite http://sharepoint.local/sites/team
$site.Url

# Cesivi
Import-Module Cesivi.PowerShell
$site = Get-CSSite -Identity "/sites/team"
$site.Url

Web Management

SharePoint Server Cesivi Notes
Get-SPWeb Get-CSWeb Identical
New-SPWeb New-CSWeb Simplified
Remove-SPWeb Remove-CSWeb Identical
Set-SPWeb Set-CSWeb Core parameters only

Example Migration:

# SharePoint Server
$web = Get-SPWeb http://sharepoint.local/sites/team/subweb
$web.Title

# Cesivi
$web = Get-CSWeb -Identity "/sites/team/subweb"
$web.Title

List Management (Coming Soon in PLAN-157)

SharePoint Server Cesivi Notes
Get-SPList Get-CSList Identical
New-SPList New-CSList Template parameter required
Remove-SPList Remove-CSList Identical
Set-SPList Set-CSList Core properties only

ListItem Operations (Coming Soon in PLAN-157)

SharePoint Server Cesivi Notes
Get-SPListItem Get-CSListItem Added -All parameter
Add-SPListItem Add-CSListItem Uses -Values hashtable
Remove-SPListItem Remove-CSListItem Identical
Set-SPListItem Set-CSListItem Uses -Values hashtable

User/Group Management (Coming Soon in PLAN-157)

SharePoint Server Cesivi Notes
Get-SPUser Get-CSUser Identical
New-SPUser New-CSUser Simplified
Remove-SPUser Remove-CSUser Identical
Get-SPGroup Get-CSGroup Identical
New-SPGroup New-CSGroup Simplified
Add-SPGroupMember Add-CSGroupMember Identical

File Operations (Coming Soon in PLAN-158)

SharePoint Server Cesivi Notes
Get-SPFile Get-CSFile Added -OutFile parameter
Add-SPFile Add-CSFile Supports -Stream parameter
Remove-SPFile Remove-CSFile Added -Recycle switch
Copy-SPFile Copy-CSFile Identical
Move-SPFile Move-CSFile Identical

Feature Management (Coming Soon in PLAN-158)

SharePoint Server Cesivi Notes
Get-SPFeature Get-CSFeature Identical
Enable-SPFeature Enable-CSFeature Identical
Disable-SPFeature Disable-CSFeature Identical

Content Type/Field Management (Coming Soon in PLAN-158)

SharePoint Server Cesivi Notes
Get-SPContentType Get-CSContentType Identical
New-SPContentType New-CSContentType Simplified
Get-SPField Get-CSField Identical
New-SPField New-CSField Core parameters only

Migration Examples

Example 1: Basic Site Management

SharePoint Server Script:

Add-PSSnapin Microsoft.SharePoint.PowerShell

# Get all sites
Get-SPSite -Limit All | Format-Table Url, Owner

# Create new site
New-SPSite -Url http://sharepoint.local/sites/newsite `
           -OwnerAlias "DOMAIN\admin" `
           -Template "STS#0"

Cesivi Equivalent:

Import-Module Cesivi.PowerShell

# Get all sites
Get-CSSite -All | Format-Table Url, Owner

# Create new site
New-CSSite -Url "/sites/newsite" `
           -Title "New Site" `
           -OwnerLogin "admin" `
           -Template "STS#0" `
           -ServerUrl "http://localhost:5000"

Example 2: Web Hierarchy Creation

SharePoint Server Script:

Add-PSSnapin Microsoft.SharePoint.PowerShell

$site = Get-SPSite http://sharepoint.local/sites/intranet
$rootWeb = $site.RootWeb

# Create department webs
$hrWeb = New-SPWeb -Url http://sharepoint.local/sites/intranet/hr `
                    -Name "HR Department"

$itWeb = New-SPWeb -Url http://sharepoint.local/sites/intranet/it `
                    -Name "IT Department"

Cesivi Equivalent:

Import-Module Cesivi.PowerShell

$site = Get-CSSite -Identity "/sites/intranet"

# Create department webs
$hrWeb = New-CSWeb -Url "hr" `
                    -Title "HR Department" `
                    -ParentWeb "/sites/intranet"

$itWeb = New-CSWeb -Url "it" `
                    -Title "IT Department" `
                    -ParentWeb "/sites/intranet"

Example 3: Bulk Site Cleanup

SharePoint Server Script:

Add-PSSnapin Microsoft.SharePoint.PowerShell

# Find and remove test sites
Get-SPSite -Limit All | Where-Object { $_.Url -like "*test*" } |
    ForEach-Object {
        Remove-SPSite -Identity $_.Url -Confirm:$false
    }

Cesivi Equivalent:

Import-Module Cesivi.PowerShell

# Find and remove test sites
Get-CSSite -All | Where-Object { $_.Url -like "*test*" } |
    ForEach-Object {
        Remove-CSSite -Identity $_.Url -Confirm:$false
    }

Example 4: Property Updates

SharePoint Server Script:

Add-PSSnapin Microsoft.SharePoint.PowerShell

$site = Get-SPSite http://sharepoint.local/sites/team
$site.RootWeb.Title = "Updated Team Site"
$site.RootWeb.Update()

Cesivi Equivalent:

Import-Module Cesivi.PowerShell

Set-CSWeb -Identity "/sites/team" -Title "Updated Team Site"

Key Differences

1. No PSSnapin (Use Import-Module)

SharePoint Server:

Add-PSSnapin Microsoft.SharePoint.PowerShell

Cesivi:

Import-Module Cesivi.PowerShell

2. REST-Based (No Direct Server Access)

  • SharePoint Server: Runs on SharePoint server, direct database access
  • Cesivi: Runs anywhere, connects via REST API

3. Simplified Parameters

Many advanced SharePoint parameters are not supported: - No -ContentDatabase parameter - No -HostHeader parameter - No -Quota parameter - No -Language parameter

Focus is on core functionality for development/testing scenarios.

4. Cross-Platform Support

  • SharePoint Server: Windows PowerShell 5.1 only
  • Cesivi: PowerShell 7+ on Windows, Linux, macOS

5. Server URL Parameter

Cesivi cmdlets require -ServerUrl parameter (or environment variable):

# Set default server URL
$env:CESIVI_SERVER_URL = "http://cesivi.example.com"

# Or specify per cmdlet
Get-CSSite -All -ServerUrl "http://cesivi.example.com"

Not Supported

These SharePoint Server cmdlets are NOT supported in Cesivi:

Farm Administration

  • Get-SPFarm
  • Get-SPServer
  • Get-SPServiceInstance
  • Start-SPServiceInstance

Database Management

  • Get-SPDatabase
  • Get-SPContentDatabase
  • Mount-SPContentDatabase

Timer Jobs

  • Get-SPTimerJob
  • Start-SPTimerJob
  • Set-SPTimerJob

Service Applications

  • Get-SPServiceApplication
  • New-SPServiceApplication
  • (Except search, if implemented)

InfoPath

  • Export-SPInfoPathForm
  • Install-SPInfoPathFormTemplate

Managed Metadata

  • Get-SPTaxonomySession
  • New-SPMetadataServiceApplication

Business Connectivity Services

  • Get-SPBusinessDataCatalogMetadataObject

Migration Checklist

  • [ ] Replace Add-PSSnapin with Import-Module
  • [ ] Replace all SP* cmdlets with CS* equivalents
  • [ ] Add -ServerUrl parameter to all cmdlets (or set environment variable)
  • [ ] Remove unsupported parameters (quota, language, etc.)
  • [ ] Update absolute URLs to relative URLs (e.g., http://sharepoint.local/sites/team/sites/team)
  • [ ] Test scripts in development environment
  • [ ] Update documentation to reference Cesivi instead of SharePoint

Troubleshooting

Module Not Found

Error:

Import-Module : The specified module 'Cesivi.PowerShell' was not loaded

Solution:

# Build the module first
dotnet build Cesivi.PowerShell

# Import using full path
Import-Module .\Cesivi.PowerShell\bin\Debug\net10.0\Cesivi.PowerShell.dll

Connection Refused

Error:

Unable to connect to Cesivi Server at http://localhost:5000

Solution:

# Start Cesivi Server first
cd Cesivi.Server
dotnet run

# Or specify different server URL
Get-CSSite -All -ServerUrl "http://cesivi.example.com"

Cmdlet Not Found

Error:

The term 'Get-CSList' is not recognized as the name of a cmdlet

Solution: Check which cmdlets are currently implemented:

Get-Command -Module Cesivi.PowerShell

Currently Implemented (PLAN-156): - Site cmdlets: Get-CSSite, New-CSSite, Set-CSSite, Remove-CSSite - Web cmdlets: Get-CSWeb, New-CSWeb, Set-CSWeb, Remove-CSWeb

Coming Soon: - PLAN-157: List, ListItem, User, Group cmdlets - PLAN-158: File, Folder, ContentType, Field cmdlets - PLAN-159: Search cmdlets (optional)

Additional Resources

  • Online Help: Use Get-Help <cmdlet-name> for detailed help
  • Examples: Use Get-Help <cmdlet-name> -Examples
  • Full Help: Use Get-Help <cmdlet-name> -Full
  • About Topics: Get-Help about_Cesivi_PowerShell
  • Cesivi Documentation: See /docs folder for guides

Support

For issues, feature requests, or questions: - GitHub Issues: https://github.com/yourorg/cesivi/issues - Documentation: https://github.com/yourorg/cesivi/docs