Month: March 2012

Saving a list as a list template & creating lists from custom template using PowerShell

Posted on Updated on

  • To save list as a template use following code

$site = get-spsite("http://testsite")

$web = $site.RootWeb

$list = $web.Lists["Announcements"]

SharePoint $list.SaveAsTemplate() PowerShell Command use following parameters.

$list.SaveAsTemplate(“Template Name”,”Template Title”,”Template Description”,1)

In the forth parameter of SaveAsTemplate(), if you want to save the specified site as template along with data use 1, otherwise use 0.

Eg:- $list.SaveAsTemplate("TestListTemplate.stp", "TestListTemplate", "Test List Template", $false)

 

  • Creating a new list from the template created.

$listTemplates = $site.GetCustomListTemplates($web)

$web.Lists.Add("TestList", "Test List", $listTemplates["TestListTemplate"])

Advertisements

Configure SharePoint to send email using Gmail Account

Posted on Updated on

Steps

  1. configure SMTP service on Windows 2008 to forward emails to Gmail servers which will send the actual emails
  2. configure SharePoint Server 2010 to send emails through your Gmail account
Configure the SMTP Server

Go to Control Panel, click on Turn Windows features on or off, go to Features, click Add Features, select SMTP Server from the list, click Add Required Role Services, click Next (a few times), click Install

  • Open Internet Information Services (IIS) 6.0 Manager under Administrative Tools, expand the node with your local computer name on it, right click on SMTP Virtual Server, click on Properties
  • on the Access tab, click on Relay …, select All except the list bellow and click OK
  • on the Delivery tab, click on Outbound Security, on the new window that opens select Basic Authentication and type your Gmail (or Google Apps) email and password in the Username and Password fields, and also select TLS encryption
  • on the Delivery tab, click Outbound connections… and in the new window that opens change TCP port to 587
  • once again in the Delivery tab, click on Advanced and in the new window that opens, in the Smart host field type smtp.gmail.com and click OK
  • click Apply, click OK.
  • Make sure POP is enabled for you Gmail account (it’s under Settings -> Forwarding and POP/IMAP).

 

configure SharePoint server to send emails using Gmail account
  • open SharePoint Central Administration, go to System Settings, go to Configure outgoing e-mail settings
  • type your computer name in the field Outbound SMTP server (I have also tried 127.0.0.1 and localhost but they did not work for me)
  • type your Gmail email address in field From address

  • click OK

Save site as template in SharePoint 2010

Posted on Updated on

  • Go to Site Actions  –> Site Settings –> Manage site features under Site Actions.
  • Deactivate the SharePoint Server Publishing feature, then go back to the Site Settings page.
  • You should now see the save as site template link.
  • After you save the template, Activate the SharePoint Server Publishing feature.