Multiple farm site creation

Hi,

I have to produce a bespoke site creation process over multiple on premise farms.  I need to ensure that site names are unique across the farms (and also do not exist on an old 2010 farm).

Initial thoughts are this will be extremely troublesome using server side code on one or more of the farms.

I am considering a separate bespoke .NET web app that uses CSOM as per: http://blogs.msdn.com/b/vesku/archive/2014/06/09/provisioning-site-collections-using-sp-app-model-in-on-premises-with-just-csom.aspx

Requesting any advice on the above idea or alternative options.

Scratching my head right now.

Thanks in advance.

Dan

August 26th, 2015 6:32am

Hi,

We can create a table in database or create a file to store all the site names in all the farms, then create a web service to check the site name whether exists or not, and then create a separate app to create a site using .Net client Object Model.

Best Regards,

Dennis Guo

Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 2:27am

Thanks Dennis,

Regards the file/database to hold all the site names in all the farms.  It is possible that the site creation process I am creating may be bypassed, in that sites may be added to the farm's via migration from other  (out of scope) farms. 

I think need an efficient way of checking each farm for a site collection existence at runtime.  Any ideas?  They will likely all exist directly via the .../sites/ URL.

Regards
Dan

September 1st, 2015 9:01am

Hi Dan,

We can use the following method to check the site whether exists or not in Client-Side.

public bool IsSiteExists(string siteURL)
{
    bool flag = false;
    try
    {
        ClientContext context = new ClientContext(siteURL);
        context.Credentials = new NetworkCredential("username","password","domain");
        context.ExecuteQuery();
        flag = true;
    }
    catch (Exception e)
    {                
        flag = false;
    }
    return flag;
}

Best Regards,

Dennis Guo

Free Windows Admin Tool Kit Click here and download it now
September 1st, 2015 9:34pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics