Ir al contenido principal

Entradas

Mostrando entradas de mayo, 2016

How To Export/Import a List Using PowerShell

Here is the sample that explains the syntax: Export-SPWeb -Identity “ http://sp.dev/subsite ” -ItemUrl “/subsite/lists/List Title here” -path “c:\temp\tempfile.txt” Some Where Options: -Identity: full url (absolute) of the site where the list exists -ItemUrl:  relative path of the list from subsite level. Do not forget to include the leading “/” -path: path of the output file to save the data in. This does not need any extension but I usually give it .txt. There are lot more additional parameters but above are the minimum for copying a list To recreate the list in other environment – I used Import-SPWeb command. PowerShell Script automatic export / import multiple lists #This is the source web that is hosting the lists to move    $sourceWebUrl = "http://source_web"          #This is the destination web, where the lists will be copied to     $destWebUrl = "http://destination_web"           #Location to store the export file     $path = &quo

Powershell script for SharePoint 2010 & SharePoint 2007 Site Usage report

SharePoint 2010 & SharePoint 2007  – Powershell script for finding site Url, Title,user Count, Primary & Secondary Site collection admins, Usage, Hits, views, Created Date, last modifed date [System.Reflection.Assembly]::Load(“Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”) # get local farm $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local # get web services from local farm $websrvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]} # format for .csv file output $outputToCSV = @() function CheckedOutItems() {     # get all web services available in the farm       foreach ($websrvc in $websrvcs) {         # retrieve web applications         foreach ($webApp in $websrvc.WebApplications) {             # now get site collections from the web application             foreach ($site in $webApp.Sites) {                 # process each web site                 Try {       

How to Backup/Restore Managed Metadata from one farm/environment to another

What? SharePoint 2010 -2013 How to Backup/Restore Managed Metadata from one farm/environment to another? Why? You will be amazed by the lack of proper import/export functionality. It is quite a general requirement to migrate Managed Metadata Service / Termsets from one environment to the other. There are a few approaches to backup/restore managed metadata between environments. OOB, SharePoint 2010 allows for ONLY importing managed metadata in CSV format. You are required to use Powershell / Object Model to build the csv file. Here is a script that can do it. Managed metadata terms and termsets each have a unique guid. If you take a backup of a site that is using managed metadata in some columns and restore this site into another environment, the guids don't match up. You will have to go through and re click each term and "wire it back up" so it's okay and doesn't show in red text. Paul Culmsee did a good job of explaining the same with nice