Rebuild SQL 2012 system databases

Have you ever wanted to reset a SQL server back to “factory defaults”? If you have ever accidentally trashed a SQL instance (hopefully a test/development instance) you can always reconfigure it back to a fresh install with the setup CD. This command will reset all of your users, all of your maintenance plans, everything back to the fresh install state, even if the service isn’t starting, etc.

!!Warning!! This will cause everything on the instance to be lost. Users, data, everything! Don’t perform this on a production instance!!

Insert the SQL CD and open a command prompt. Change directory into the root of the CD;

D:

Then run this command

Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=sql1 /SQLSYSADMINACCOUNTS=domain\user /SAPWD=StrongPassword

Obviously the Instance name would match your instance. If the default instance is your target, use MSSQLSERVER.

If you have changed the System database/log locations, they all will be changed back to the default locations (Data root directory).

More info is available here.
http://msdn.microsoft.com/en-us/library/dd207003.aspx

Cris.