SMS SQL for Duplicate Collection Names
Recently, I've found many collections with duplicate names. The dupes can cause problems when managing those collections. I quickly created the following SQL to find the offending collections. -- This SQL query will show collections with duplicate names. Select parentCollectionID, ParentCollection.Name, v_Collection.CollectionID, v_Collection.Name from v_Collection left outer join v_CollectToSubCollect on v_Collection.collectionid=v_CollectToSubCollect.subcollectionid left outer join v_Collection ParentCollection on v_CollectToSubCollect.parentCollectionID = ParentCollection.collectionid where v_Collection.Name in (Select Name from v_Collection Group By Name Having Count(*)>1) About the Author Emmanuel Tsouris is a Systems Management veteran and Developer Advocate specializing in PowerShell and Cloud Automation. He maintains DotVBS to preserve legacy knowledge for the "archaeologist admin." ...