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

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()

July 22nd, 2013 5:58am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics