I'm wanting to retrieve all items within a Video Library on SharePoint and grab the owners/Created By list and all that I haven't been able to target videos only.
I'm able to pull in all of the document libraries:
How do I pull items in only from the Video library?
Here is what I currently have:
# Add SharePoint Snapin to PowerShell
if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
Add-PSSnapin Microsoft.SharePoint.PowerShell
}
$web = Get-SPWeb "http://sourcevideo.f.com"
$Data = foreach ($list in $web.Lists) {
if ($list.BaseType -eq “DocumentLibrary”) {
foreach ($item in $list.Items) {
foreach($version in $item.Versions){
$data = @{
"Version" = $version.VersionLabel
"List Name" = $list.Title
"Created By" = $item["Author"]
"Created Date" = $item["Created"]
"Modified By" = $item["Editor"]
"Modified Date" = $item["Modified"]
"Item Name" = $item.File.Name
"URL"=$web.Site.MakeFullUrl("$($web.ServerRelativeUrl.TrimEnd('/'))/$($item.Url)");
}
New-Object PSObject -Property $data | Select "List Name", "Item Name", "Version", "Created By", "Created Date", "Modified By", "Modified Date", "URL"
}
}
$web.Dispose();
}
}
$Data | Export-Csv C:\Users\ptadmin\Desktop\process7.csv -NoTypeInformation