Hi how to import/export list from SharePoint 2013 to 2010 with powershell ?
## Specify the site URL from where you need to get all the list items $webURL=“http://serverName:46563/sites/MMS”
## Specify the list name from where you need to get the list items
[string]$listName = “List”
## Specify the location where the output xml file GetListItems.xml file has to be generated $outputXmlFilePath=“D:\VijaiPOC\GetListItems.xml”
## $viewName is a string that contains the GUID of the view. If you give empty value it will take the values from default view
[string]$viewName = “”
## $rowLimit is a string that contains number of items to be retreived from the list
[string]$rowLimit = “50”
[String]$viewFieldsValue=“<FieldRef Name=’Title’ />”
[String]$queryValue=“<Where><Gt><FieldRef Name=’ID’/><Value Type=’Number’>3</Value></Gt></Where>”
[String]$queryOptionsValue=“”
#——— Get List Items Function ———-
Function GetListItems()
{
Write–Host –ForegroundColor Green “Please pass the credentials that have access to the site: “$webURL
$credential=Get–Credential
$uri=$webURL+“/_vti_bin/Lists.asmx?wsdl” $listsWebServiceReference = New–WebServiceProxy –Uri
$uri –Credential $credential [System.Xml.XmlDocument]$xmlDoc=New–Object –TypeName System.Xml.XmlDocument [System.Xml.XmlElement]
$query = $xmlDoc.CreateElement(“Query”) [System.Xml.XmlElement]$viewFields =$xmlDoc.CreateElement(“ViewFields”) [System.Xml.XmlElement]$queryOptions =$xmlDoc.CreateElement(“QueryOptions”) $viewFields.InnerXml = $viewFieldsValue $query.InnerXml = $queryValue $queryOptions.InnerXml = $queryOptionsValue [System.Xml.XmlNode]$nodeListItems =$listsWebServiceReference.GetListItems($listName, $viewName, $query, $viewFields, $rowLimit, $queryOptions, $null) $output = New–Object –TypeName System.IO.StreamWriter –ArgumentList $outputXmlFilePath, $false
$output.WriteLine($nodeListItems.Outerxml)
$output.WriteLine()
$output.Dispose()
Write–Host –ForegroundColor Green “Output file is generated in the path: “$outputXmlFilePath }
#——— Calling the Function ———–
GetListItems