Click here to Skip to main content
15,910,886 members

Comments by Member 12990028 (Top 2 by date)

Member 12990028 8-Feb-17 16:48pm View    
Final code which is running and i got the data in the excel file. But its not populating "CreatedBy" columns value? Do you know why?


Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue

$MyWeb = Get-SPWeb -identity "http://cclportal/reservations/surveys"
$MyList = $MyWeb.Lists["CareTeam Application"]
$ListItemCollection = @()
 
 
$MyList.Items | foreach {
$ExportItem = New-Object PSObject
 
$ExportItem | Add-Member -MemberType NoteProperty -name "Created" -value $_["Created"]
 
$ExportItem | Add-Member -MemberType NoteProperty -Name "Requestors Email" -value $_["Requestors Email"]
$ExportItem | Add-Member -MemberType NoteProperty -Name "Employee Name" -value $_["Employee Name"]
$ExportItem | Add-Member -MemberType NoteProperty -Name "Status" -value $_["Status"]
 
#Add the object with property to an Array
 
$ListItemCollection += $ExportItem
 
}
 
#Export the result Array to CSV file
 
$ListItemCollection | Export-CSV "c:\testexport.csv" -NoTypeInformation
Member 12990028 8-Feb-17 16:46pm View    
Thank you.