Create site collection in content database












5














I want to set by default to create a site collection in an independent content database when creating a new site collection automatically!



Ex: each content database only holds one site collection by default!



Is it possible to do that automatically without using code?










share|improve this question





























    5














    I want to set by default to create a site collection in an independent content database when creating a new site collection automatically!



    Ex: each content database only holds one site collection by default!



    Is it possible to do that automatically without using code?










    share|improve this question



























      5












      5








      5







      I want to set by default to create a site collection in an independent content database when creating a new site collection automatically!



      Ex: each content database only holds one site collection by default!



      Is it possible to do that automatically without using code?










      share|improve this question















      I want to set by default to create a site collection in an independent content database when creating a new site collection automatically!



      Ex: each content database only holds one site collection by default!



      Is it possible to do that automatically without using code?







      sharepoint-server 2016 site-collection






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 17 '18 at 19:40







      Tomaz

















      asked Dec 15 '18 at 14:59









      TomazTomaz

      776




      776






















          2 Answers
          2






          active

          oldest

          votes


















          5














          I don't think it's possible automatically.




          Unfortunately, There is no event receiver triggered when creating/ created a site collection to handle this using event receiver.






          However, you can adjust this manually by locking down the content database as the following:



          Steps



          Before creating a new site collection, you should plan to do the following:




          • Lockdown all the web application content databases.


          • Create a new independent content database for the new Site Collection.



            enter image description here



          • Create a new Site Collection will be created inside the newly created content database.



          Check also Lockdown the web application content databases





          Another workaround



          Using PowerShell to Create a SharePoint Site Collection in an Independent Content Database



          Download the full script at PowerShell: Create a SharePoint Site Collection in a Separate Content Database






          share|improve this answer





















          • @Tomaz be aware that this is not correct and it is possible to do what you're asking.
            – Trevor Seward
            Dec 17 '18 at 15:58






          • 1




            Thanks Trevor, but your answer is not doable in my situation, I need to do it automatically and your answer requires code too, I think Mohamed answer is the correct one, I cannot do this automatically without code! The lockdown solution is the best one in my case!
            – Tomaz
            Dec 17 '18 at 19:39





















          4














          Yes, this is possible by overriding the class SPSiteCreationProvider. With this, you can select all of your existing content databases. If you cannot find a content database in the web application that meets the criteria, you could then create a new content database.



          You should be aware that this would slow down the site creation process significantly as provisioning a new content database isn't an instant process.



          I'm linking to Wictor's article below which references HNSC, but this will also apply to path-based site collections.



          SharePoint: Specifying Content Database for new Site Collections when using Host Named Site Collections






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "232"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsharepoint.stackexchange.com%2fquestions%2f254369%2fcreate-site-collection-in-content-database%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            5














            I don't think it's possible automatically.




            Unfortunately, There is no event receiver triggered when creating/ created a site collection to handle this using event receiver.






            However, you can adjust this manually by locking down the content database as the following:



            Steps



            Before creating a new site collection, you should plan to do the following:




            • Lockdown all the web application content databases.


            • Create a new independent content database for the new Site Collection.



              enter image description here



            • Create a new Site Collection will be created inside the newly created content database.



            Check also Lockdown the web application content databases





            Another workaround



            Using PowerShell to Create a SharePoint Site Collection in an Independent Content Database



            Download the full script at PowerShell: Create a SharePoint Site Collection in a Separate Content Database






            share|improve this answer





















            • @Tomaz be aware that this is not correct and it is possible to do what you're asking.
              – Trevor Seward
              Dec 17 '18 at 15:58






            • 1




              Thanks Trevor, but your answer is not doable in my situation, I need to do it automatically and your answer requires code too, I think Mohamed answer is the correct one, I cannot do this automatically without code! The lockdown solution is the best one in my case!
              – Tomaz
              Dec 17 '18 at 19:39


















            5














            I don't think it's possible automatically.




            Unfortunately, There is no event receiver triggered when creating/ created a site collection to handle this using event receiver.






            However, you can adjust this manually by locking down the content database as the following:



            Steps



            Before creating a new site collection, you should plan to do the following:




            • Lockdown all the web application content databases.


            • Create a new independent content database for the new Site Collection.



              enter image description here



            • Create a new Site Collection will be created inside the newly created content database.



            Check also Lockdown the web application content databases





            Another workaround



            Using PowerShell to Create a SharePoint Site Collection in an Independent Content Database



            Download the full script at PowerShell: Create a SharePoint Site Collection in a Separate Content Database






            share|improve this answer





















            • @Tomaz be aware that this is not correct and it is possible to do what you're asking.
              – Trevor Seward
              Dec 17 '18 at 15:58






            • 1




              Thanks Trevor, but your answer is not doable in my situation, I need to do it automatically and your answer requires code too, I think Mohamed answer is the correct one, I cannot do this automatically without code! The lockdown solution is the best one in my case!
              – Tomaz
              Dec 17 '18 at 19:39
















            5












            5








            5






            I don't think it's possible automatically.




            Unfortunately, There is no event receiver triggered when creating/ created a site collection to handle this using event receiver.






            However, you can adjust this manually by locking down the content database as the following:



            Steps



            Before creating a new site collection, you should plan to do the following:




            • Lockdown all the web application content databases.


            • Create a new independent content database for the new Site Collection.



              enter image description here



            • Create a new Site Collection will be created inside the newly created content database.



            Check also Lockdown the web application content databases





            Another workaround



            Using PowerShell to Create a SharePoint Site Collection in an Independent Content Database



            Download the full script at PowerShell: Create a SharePoint Site Collection in a Separate Content Database






            share|improve this answer












            I don't think it's possible automatically.




            Unfortunately, There is no event receiver triggered when creating/ created a site collection to handle this using event receiver.






            However, you can adjust this manually by locking down the content database as the following:



            Steps



            Before creating a new site collection, you should plan to do the following:




            • Lockdown all the web application content databases.


            • Create a new independent content database for the new Site Collection.



              enter image description here



            • Create a new Site Collection will be created inside the newly created content database.



            Check also Lockdown the web application content databases





            Another workaround



            Using PowerShell to Create a SharePoint Site Collection in an Independent Content Database



            Download the full script at PowerShell: Create a SharePoint Site Collection in a Separate Content Database







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 15 '18 at 16:14









            Mohamed El-Qassas MVPMohamed El-Qassas MVP

            39.8k64084




            39.8k64084












            • @Tomaz be aware that this is not correct and it is possible to do what you're asking.
              – Trevor Seward
              Dec 17 '18 at 15:58






            • 1




              Thanks Trevor, but your answer is not doable in my situation, I need to do it automatically and your answer requires code too, I think Mohamed answer is the correct one, I cannot do this automatically without code! The lockdown solution is the best one in my case!
              – Tomaz
              Dec 17 '18 at 19:39




















            • @Tomaz be aware that this is not correct and it is possible to do what you're asking.
              – Trevor Seward
              Dec 17 '18 at 15:58






            • 1




              Thanks Trevor, but your answer is not doable in my situation, I need to do it automatically and your answer requires code too, I think Mohamed answer is the correct one, I cannot do this automatically without code! The lockdown solution is the best one in my case!
              – Tomaz
              Dec 17 '18 at 19:39


















            @Tomaz be aware that this is not correct and it is possible to do what you're asking.
            – Trevor Seward
            Dec 17 '18 at 15:58




            @Tomaz be aware that this is not correct and it is possible to do what you're asking.
            – Trevor Seward
            Dec 17 '18 at 15:58




            1




            1




            Thanks Trevor, but your answer is not doable in my situation, I need to do it automatically and your answer requires code too, I think Mohamed answer is the correct one, I cannot do this automatically without code! The lockdown solution is the best one in my case!
            – Tomaz
            Dec 17 '18 at 19:39






            Thanks Trevor, but your answer is not doable in my situation, I need to do it automatically and your answer requires code too, I think Mohamed answer is the correct one, I cannot do this automatically without code! The lockdown solution is the best one in my case!
            – Tomaz
            Dec 17 '18 at 19:39















            4














            Yes, this is possible by overriding the class SPSiteCreationProvider. With this, you can select all of your existing content databases. If you cannot find a content database in the web application that meets the criteria, you could then create a new content database.



            You should be aware that this would slow down the site creation process significantly as provisioning a new content database isn't an instant process.



            I'm linking to Wictor's article below which references HNSC, but this will also apply to path-based site collections.



            SharePoint: Specifying Content Database for new Site Collections when using Host Named Site Collections






            share|improve this answer


























              4














              Yes, this is possible by overriding the class SPSiteCreationProvider. With this, you can select all of your existing content databases. If you cannot find a content database in the web application that meets the criteria, you could then create a new content database.



              You should be aware that this would slow down the site creation process significantly as provisioning a new content database isn't an instant process.



              I'm linking to Wictor's article below which references HNSC, but this will also apply to path-based site collections.



              SharePoint: Specifying Content Database for new Site Collections when using Host Named Site Collections






              share|improve this answer
























                4












                4








                4






                Yes, this is possible by overriding the class SPSiteCreationProvider. With this, you can select all of your existing content databases. If you cannot find a content database in the web application that meets the criteria, you could then create a new content database.



                You should be aware that this would slow down the site creation process significantly as provisioning a new content database isn't an instant process.



                I'm linking to Wictor's article below which references HNSC, but this will also apply to path-based site collections.



                SharePoint: Specifying Content Database for new Site Collections when using Host Named Site Collections






                share|improve this answer












                Yes, this is possible by overriding the class SPSiteCreationProvider. With this, you can select all of your existing content databases. If you cannot find a content database in the web application that meets the criteria, you could then create a new content database.



                You should be aware that this would slow down the site creation process significantly as provisioning a new content database isn't an instant process.



                I'm linking to Wictor's article below which references HNSC, but this will also apply to path-based site collections.



                SharePoint: Specifying Content Database for new Site Collections when using Host Named Site Collections







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 16 '18 at 1:13









                Trevor SewardTrevor Seward

                19.6k31644




                19.6k31644






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to SharePoint Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsharepoint.stackexchange.com%2fquestions%2f254369%2fcreate-site-collection-in-content-database%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Plaza Victoria

                    In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

                    How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...