Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

Export Sharepoint 2010 office365 list items into .csv file using managment shell

$
0
0

Hi,

        By using the below Code I am able to add list item into Office 365 SharePoint List.

I need to export all of the list items into any format like excel/csv/word.

please do the needful

Add-Type –Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type –Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

$siteUrl = “site URL here”
$password = Read-Host -Prompt "Enter password" -AsSecureString
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials("username", $password)
$ctx.Credentials = $credentials
$list = $ctx.get_web().get_lists().getByTitle('Learnings');
$itemCreateInfo = New-Object Microsoft.SharePoint.Client.ListItemCreationInformation
$listItem = $list.addItem($itemCreateInfo);
$listItem.set_item('Title', 'Test3');
$listItem.update();
$ctx.Load($listItem)
$ctx.ExecuteQuery()


Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>