Deleting items in a SharePoint Online document library in bulk (100k's +)

%3CLINGO-SUB%20id%3D%22lingo-sub-468502%22%20slang%3D%22en-US%22%3EDeleting%20items%20in%20a%20SharePoint%20Online%20document%20library%20in%20bulk%20(100k's%20%2B)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-468502%22%20slang%3D%22en-US%22%3E%3CP%3EA%20Microsoft%20Support%20case%20pointed%20me%20here%20in%20the%20hopes%20someone%20here%20has%20an%20answer%20to%20this.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20looking%20for%20a%20better%20way%20to%20delete%20document%20libraries%20that%20have%20500%2C000%2B%20items%2C%26nbsp%3Bto%20some%20with%20over%26nbsp%3B1%20million%20items.%26nbsp%3B%20You%20cannot%20delete%20the%20library%20because%20it's%20over%20the%20100%2C000%20item%20threshold%20for%20deleting%20a%20library%20as%20a%20whole%20through%20the%20UI.%26nbsp%3B%20My%20work-around%20so%20far%20is%20I've%20written%20a%20PowerShell%20script%20that%20goes%20through%20and%20deletes%20items%20one-by-one%20until%20it%20gets%20under%20100%2C000%20then%20I%20can%20delete%20the%20library.%26nbsp%3B%20Not%20great%2C%20but%20at%20least%20it's%20automated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20thoughts%5Cideas%20are%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

A Microsoft Support case pointed me here in the hopes someone here has an answer to this. 

 

I'm looking for a better way to delete document libraries that have 500,000+ items, to some with over 1 million items.  You cannot delete the library because it's over the 100,000 item threshold for deleting a library as a whole through the UI.  My work-around so far is I've written a PowerShell script that goes through and deletes items one-by-one until it gets under 100,000 then I can delete the library.  Not great, but at least it's automated.

 

Any thoughts\ideas are appreciated.

0 Replies