Saturday, 20 October 2012

Export List Data using Powershell

Add-PsSnapin Microsoft.SharePoint.Powershell –ErrorAction SilentlyContinue

$MyWeb = Get-SPWeb "http://Globas"
$MyList = $MyWeb.Lists["sample"]
$exportlist = @()
$Mylist.Items | foreach {
$obj = New-Object PSObject -Property @{
            “Column1” = $_["Body"]
                          
}
$exportlist += $obj
$exportlist | Export-Csv -path 'C:\dom.csv'
}

No comments:

Post a Comment