SharePoint: Como obtener la plantilla de un sitio existente con PowerShell!

En esta ocasión os dejo un Script que permite obtener la plantilla usada en un sitio existente de SharePoint (versiones 2010 a 2016). Podéis descargaros el script desde el siguiente enlace: How to get the site template for an existing SharePoint Site

############################################################################################################################################

# Script that allows to get the template of an existing SharePoint Site

# Required parameters: 

#   -> $sSiteCollectionUrl: Site Collection Url.

############################################################################################################################################

 

If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) 

{ Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell }

 

$host.Runspace.ThreadOptions = "ReuseThread"

 

#Definition of the function that gets the template for an existing site

function Get-SiteTemplate

{  

    param ($sSiteCollectionUrl)

    try

    {

        Write-Host "Getting the template used by $sSiteCollectionUrl"

        $spsSite =  Get-SPSite -Identity $sSiteCollectionUrl

        $spwWeb=$spsSite.OpenWeb()

        Write-Host "Site Template: "  $spwWeb.WebTemplate  " - Site Template ID: " $spwWeb.WebTemplateId -ForegroundColor Green

        $spwWeb.Dispose()

        $spsSite.Dispose()

 

    }

    catch [System.Exception]

    {

        Write-Host -ForegroundColor Red $_.Exception.ToString()

    }

}

 

Start-SPAssignment –Global

$sSiteCollectionUrl="http://sp2016es2/"

Get-SiteTemplate -sSiteCollectionUrl $sSiteCollectionUrl

Stop-SPAssignment –Global

 

Remove-PsSnapin Microsoft.SharePoint.PowerShell

2 pensamientos en “SharePoint: Como obtener la plantilla de un sitio existente con PowerShell!

  1. Pingback: SharePoint & Office 365: Resumen de posts (VIII)! | Pasión por la tecnología...

Deja una respuesta

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Salir /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Salir /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Salir /  Cambiar )

Conectando a %s