Archive for February, 2011

SharePoint 2010: PowerShell Script – Add Column in Custom List

Scenario:

We need to create PowerShell script to create a custom list and a column in the list

Script:

try

{

$weburl = Read-Host “Please enter web url (like : http://sharepoint.ffaiz.com)”

$spweb = Get-SPWeb $weburl

$listTemplate = [Microsoft.SharePoint.SPListTemplateType]::GenericList

$spweb.Lists.Add(“My List”,”My list description”,$listTemplate)

write-host “List added in the Web : ” $spweb -foregroundcolor Yellow

 

$spList = $StartSite.Lists[“My Lists”]

$spFieldType = [Microsoft.SharePoint.SPFieldType]::Text

$spList.Fields.Add(“My Column”,$spFieldType,$false)

write-host “Column added in the list”

 

$spweb.Dispose()

}

catch [System.SystemException]

{

write-host “Execution stopped due to: “+$_.Message -foregroundcolor Red

}

Comments (1)

Inside Microsoft SharePoint 2010

I am waiting for this book quiet sometime. Hopefully we will be able to read it in near future J

http://oreilly.com/catalog/9780735627468

Thanks to Ted Pattison, Andrew Connell, Scot Hillier, David Mann and Microsoft.

Oh, this reminds me Patrick Tisseghem and his master piece Inside Microsoft Office SharePoint Server 2007. RIP Patrick.

Leave a Comment

SharePoint 2010 Event @ Government College University

I spoke at introductory event on SharePoint 2010 organized by Microsoft Pakistan and Computer Science Society Government College, University Lahore. First part of the event covered SharePoint 2010 presentation and demonstration held on February 1st, 201. Second part was a workshop on SharePoint 2010 held on February 3rd, 2011.

Saqib was the contact person representing Computer Science Society Government College, University Lahore. Audience includes CS undergrad. from 1st year to final year. It was great to see so much motivated and passionate students curious about SharePoint. You can find snaps @ https://picasaweb.google.com/farhan.faiz/SharePoint2010IntroductionEvent?authkey=Gv1sRgCOC61ub-qdyxGw#

Many thanks to Raymond Mitchell and Wes Preston for sharing their contents. Also, for great SharePoint User Group Minneota SharePoint User Group.

Leave a Comment