Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a list of more then 9000 items, the user want me to move items from that list to a folder. As administrator I created a view that shows the 9000 items (in pages of 250 items).

However if I use the "Site Content and Structure" and go to that list, it shows the default view and I see some folders there (but not the items that are not yet in a folder) and if a switch to my own (just created) view, it does show me the items in a "normal screen" it does'nt show me the items in the "Site Content and Structure" and now I cannot move the items ..please advice

share|improve this question

1 Answer 1

You can use powershell script to move items from that list to folder (example):

1.Get list from web

[Microsoft.SharePoint.SPSite] $Site = New-Object Microsoft.SharePoint.SPSite($WebURL);             
[Microsoft.SharePoint.SPWeb] $Web = $Site.OpenWeb();             
[Microsoft.SharePoint.SPList] $List = $Web.Lists[$ListDisplayName];  

2.Then create a query to get all files without folders and move it all to new folder

$FolderToMoveTo = $List.RootFolder.Url + "/" + $FolderName;            
$ItemMoveCount=0;                         
$Query = New-Object Microsoft.SharePoint.SPQuery;             
$Query.Folder = $list.RootFolder;     
$camlQuery = "<Where></Where>"
$Query.Query = $camlQuery         
$Query.RowLimit = 9000; #limit query because of large folder    
$List.GetItems($Query) | Where {$_.ContentType.Name -ne "Folder"} |              
foreach-object {                     
 #Line below will simply output to console and demonstrates another .NET call             
 [System.String]::format("Moving Item {0} with ID {1}...",$_.Name, $_.ID.ToString());             
 $Web.GetFile($_.Url).MoveTo([System.String]::format({0}/{1}",$FolderToMoveTo,$_.Name));            
 write-host "Success...";             
 $ItemMoveCount++;             
};             

3.Dispose web and site

#dispose:             
$Web.Dispose();             
$Site.Dispose(); 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.