Are you someone that likes to go through your web applications and dismount your databases prior to patching? Or maybe you’re just moving a content database from one web application to another. Or maybe, just maybe, you want to dismount a content database for the fun of it!
Well, if that’s you, you might have noticed (or maybe not), that when the content database is remounted, a few properties get reset to their default values such as MaximumSiteCount and WarningSiteCount (2,000 and 5,000 respectively). This can be pretty inconvenient (to say the least!) if you’ve modified these settings in any way and even more inconvenient if you didn’t document them before running Dismount-SPContentDatabase.
Once again, it’s our friend PowerShell to the rescue. The following functions allow you to dismount all of the content databases in a given web application (Dismount-SPContentDatabases) while retaining the pertinent settings in CSV file. The function helpfully titled Mount-SPContentDatabases will remount the content databases (using Mount-SPContentDatabase) to the supplied web application using the previous settings (including the original DatabaseServer), thus saving you at least 5 minutes to enjoy an additional cup of coffee.
Imagine you have a web application with the name ContosoIntranet.