Wednesday 24 September 2014

The following Script for Saving Site as a Template using Powershell:


$Web=Get-SPWeb http://Servername:port/yourSite

$Web.SaveAsTemplate("Template Name","Template Title","Template

Description",1)

Msdn

# Get a reference to the target site

$web = Get-SPWeb http://yoursitename

# Update the property bage value and set it  to the string value "true"

$web.AllProperties["SaveSiteAsTemplateEnabled"] = "true"

# Commit the property change to server

$web.Update()


Please Note that your site should be a publishing Site if not Enable it under Site Options - Set Publishing to true






The following Script helps us whether the SMTP service is Set on Our Sharepoint Site.


$site = New-Object Microsoft.SharePoint.SpSite("Your Site Name")
$web = $site.OpenWeb()
$sent = [Microsoft.Sharepoint.Utilities.SpUtility]::SendEmail

($web,0,0,”yourmail@domain.com”,”Test mail subject”,”test mail
body”)
$sent

If the SMTP settings are configured Properly in the Server then a test mail will be delivered to the given Mail ID.