I have a multisite installation of WordPress with 200+ sites. I recently was tasked to do an inventory of each site's media library and was wondering if this could be accomplished programmatically with a script? If so, what would be the most efficient way to query each site's media library?
You may want to check this: How do I query all posts of one type across my multisite installation?
Just change post to media and you'll be fine.