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 at 19:40

























      asked Dec 15 at 14:59









      Tomaz

      746




      746






















          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





















          • It makes sense, thank you!
            – Tomaz
            Dec 15 at 16:26










          • @Tomaz be aware that this is not correct and it is possible to do what you're asking.
            – Trevor Seward
            Dec 17 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 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





















            • It makes sense, thank you!
              – Tomaz
              Dec 15 at 16:26










            • @Tomaz be aware that this is not correct and it is possible to do what you're asking.
              – Trevor Seward
              Dec 17 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 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





















            • It makes sense, thank you!
              – Tomaz
              Dec 15 at 16:26










            • @Tomaz be aware that this is not correct and it is possible to do what you're asking.
              – Trevor Seward
              Dec 17 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 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 at 16:14









            Mohamed El-Qassas MVP

            39.6k63983




            39.6k63983












            • It makes sense, thank you!
              – Tomaz
              Dec 15 at 16:26










            • @Tomaz be aware that this is not correct and it is possible to do what you're asking.
              – Trevor Seward
              Dec 17 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 at 19:39




















            • It makes sense, thank you!
              – Tomaz
              Dec 15 at 16:26










            • @Tomaz be aware that this is not correct and it is possible to do what you're asking.
              – Trevor Seward
              Dec 17 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 at 19:39


















            It makes sense, thank you!
            – Tomaz
            Dec 15 at 16:26




            It makes sense, thank you!
            – Tomaz
            Dec 15 at 16:26












            @Tomaz be aware that this is not correct and it is possible to do what you're asking.
            – Trevor Seward
            Dec 17 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 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 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 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 at 1:13









                Trevor Seward

                19.5k31543




                19.5k31543






























                    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

                    數位音樂下載

                    When can things happen in Etherscan, such as the picture below?

                    格利澤436b