How To Restore the ‘All Systems’ Collection

The default All Systems collection is special in the sense that it has a unique Collection ID (SMS00001). In case you end up 'accidentally' deleting the All Systems collection from your SMS/SCCM console, the only way to restore it with the default Collection ID is programmatically. Here's a script that does that, along with adding the Collection Query and the Update Schedule.