I recently needed to migrate all documents that hadn’t been modified in 90 days in all SharePoint webs within a SharePoint site collection to a records center. There could potentially be hundreds of libraries and content types and creating Information Management Policies at this point wasn’t really feasible. With some good upfront planning, that would have been the preferable method, but this was the quick and easy way to accomplish the task.
This script takes two URLs as parameters and the number of days to compare against the last modified date. The two URLs are the root of the site collection you want to archive documents in, and the other is the path to the destination library where the documents will be moved.