Posts

Showing posts from February, 2012

How to Import/Export Custom Content Types in SharePoint 2010 using Powershell

Let us first create two files of which the file names and content will be as follows: 1. File Name: CTypes.ps1. This file contains the script to export existing site content types (From: http://apps-d/myApp and Content types group: My Custom Content Types ) into an XML script (To: D:\Development\SharePoint\MYAPP\Scripts\Script-SiteContentTypes.xml) $sourceWeb = Get-SPWeb http://apps-d/myApp $xmlFilePath = "C:\Script-SiteContentTypes.xml" #Create Export File New-Item $xmlFilePath -type file -force #Export Content Types to XML file Add-Content $xmlFilePath " " Add-Content $xmlFilePath "`n " $sourceWeb.ContentTypes ForEach-Object { if ($_.Group -eq "My Custom Content Types") { Add-Content $xmlFilePath $_.SchemaXml } } Add-Content $xmlFilePath " " $sourceWeb.Dispose() 2. File Name: Import.ps1. This file contains the script to import the content types into http://206137l/MyApp from XML script (To: C:\Script-SiteContentTypes.xml) $destWeb = G

Installing SharePoint 2010 in Windows 7

Image
Installing SharePoint 2010 in Windows 7 is recommended for development environment and not intended for a full blown production SharePoint Farm. Installing SharePoint 2010 in windows 7 may be little bit tricky and this is why I wanted to put those issues and fixes together in my blog. Let us start the installation process. 1. Preconfigure your Windows 7 host system: As a hardware recommendation 4GB should be ok and 8GB will be better if you want to use Visual Studio and SharePoint Designer working on the same machine and running side-by-side. Install the WCF Hotfix for Microsoft Windows. The hotfix is available in Windows Server 2008 R2 and Windows 7 . This hotfix also updates the ASP.NET common language runtime (CLR) to recognize a new option of optimizing compilations. To take advantage of this option, set the optimize Compilations property of the <compilation> tag in your web.config file to true: <compilation optimizeCompilations="true">. For Windows 7, the s