Arrays of non-interacting nanomagnets are widespread in data storage and processing. As current technologies approach fundamental limits on size and thermal stability, enhancing functionality through embracing the strong interactions present at high array densities becomes attractive. In this respect, artificial spin ices are geometrically frustrated magnetic metamaterials that offer vast untapped potential due to their unique microstate landscapes, with intriguing prospects in applications from reconfigurable logic to magnonic devices or hardware neural networks. However, progress in such systems is impeded by the inability to access more than a fraction of the total microstate space. Here, we demonstrate that topological defect-driven magnetic writing—a scanning probe technique—provides access to all of the possible microstates in artificial spin ices and related arrays of nanomagnets. We create previously elusive configurations such as the spin-crystal ground state of artificial kagome dipolar spin ices and high-energy, low-entropy ‘monopole-chain’ states that exhibit negative effective temperatures.