Scripted Deployment of a #SystemCenter Configuration Manager 2012 Secondary Site #ITCamp #SMS

In System Center 2012 Configuration Manager, you can no longer deploy a secondary site server using Setup (wizard or scripted).  Instead, you must use the Configuration Manager console to create a new secondary site.  This is less than ideal if you want to deploy several secondary sites or want to automate the process for any other reason.

To address the need for automating the deployment of Configuration Manager 2012 Secondary Sites, Jim Dempsey, Config Mgr Program Manager, has developed a VBScript as a CodePlex community project that leverages the Windows Management Instrumentation (WMI) to write the necessary changes to the Site Control file so that a Primary Site server will deploy the intended Secondary Sites.  A PowerShell version of this script is expected in the near future from our MVP community.

After downloading the script, just change the below variables to match your Configuration Manager installation and then run the script as a Configuration Manager Site Admin to kick things off!

Script Variables to Modify for your Installation:

  • DNSDomainName – FQDN for the domain in which both the primary and secondary sites reside (e.g.
  • PrimarySiteCode – 3-character site code for an existing primary site that will be the parent of the new secondary site
  • PrimarySiteServerName – NetBIOS name of the primary site server computer (must match DNS hostname)
  • SecondarySiteCode – unique 3-character site code for the new secondary site
  • SecondarySiteServerName – NetBIOS name of the secondary site server computer (must match DNS hostname)
  • SecondarySiteName – brief description used to identify the new secondary site
  • SecondarySiteInstallFolder – local drive path on secondary site server where ConfigMgr will be installed (include trailing backslash, e.g. D:\ConfigMgr\)
  • InstallSQLExpress – flag to determine if SQL Express should be installed or not (0 = Don’t Install, 1 = Install)
  • SQLInstanceName – SQL Server instance to be used for the secondary site database (optional if InstallSQLExpress = 0, ignored if InstallSQLExpress = 1)
  • SQLDatabaseName – database name to be used for the secondary site database (required if InstallSQLExpress = 0, ignored if InstallSQLExpress = 1)
  • SQLServicePort – port number to be used for the SQL Server Engine (required if InstallSQLExpress = 1, ignored if InstallSQLExpress = 0)
  • SSBPort – port number to be used for the SQL Service Broker (required, used for intersite database replication)
  • AlternateBuildSourcePath – Local drive path on secondary site server or UNC path where the ConfigMgr installation media and prerequisite files can be found (optional – leave blank to push from primary site)
  • IsProtected – flag to determine if clients can fallback to this site’s distribution point when a preferred distribution point is not available (0 = allow fallback, 1 = do not allow fallback)

You can download the script from Jim’s project on CodePlex.  Kudos to Jim Dempsey for developing this script!

Comments (7)
  1. KeithMayer says:

    Yes – good point.  A PowerShell version is on the way! 🙂

  2. Interesting that the choice of code was VBS and not PowerShell considering the almost tidal wave push of PowerShell cmdLets and code samples from Microsoft directly.

  3. KeithMayer says:

    Hi Thomas,

    Great question!  There's a sample script for adding site roles at the following link location:…/hh949636.  Each site role has a distinct set of embedded properties, so depending on the role(s) you're looking to deploy, this script would need to be adjusted to accommodate the relevant list of embedded properties for each role.



  4. Thanks! I just looked over the code and it's easy enough to do, but I was just thrown off wondering if there was perhaps some special reason for this.

  5. KeithMayer says:

    Hi Jim,

    That's great additional information …Thanks so much for sharing!

    Best regards,


  6. Thomas Forsmark Soerensen says:

    Hi Keith,

    Thanks for the script. Just what I was missing.

    Do you alto have a script that can add a system role to an existing central or primary site?



  7. Jim Dempsey says:

    To go along with the link Keith provided for the site system installation sample, you may also be wondering how you can figure out what WMI embedded properties need to be set for each site system role.  To figure that out, you can leverage the preinst.exe tool that comes with Configuration Manager.  Using the preinst.exe tool with the /dump parameter will create a file representation of the site control file information that is stored in the database.  If you do that, then manually deploy the desired site system through the console, and then run preinst.exe /dump again afterward, you can compare the before and after site control files to determine what changes were made for that site system role.


Comments are closed.