BrightWork Template Design Sync enables you to make changes to a BrightWork template and pull those changes into project area sites that were created using the template.

This document describes how to:

  • Sync multiple sites simultaneously with PowerShell
  • Remove site to template bindings on site-by-site basis using either SharePoint Designer or PowerShell

Prerequisites

Ideally, you should be a SharePoint administrator with experience in using PowerShell. To carry out the PowerShell tasks described in this document, you need admin-level access to the SharePoint server on which BrightWork is installed.

You should also review the Design Sync topics in the BrightWork help, so you fully understand what the Design Sync does.

Sync Sites with Template

The Template Design Sync works on a site-by-site basis. If you have an updated template that has been used to create many sites, manually running the Design Sync on all these sites could take a while.

This section describes how to use a PowerShell Script, provided by BrightWork, to sync multiple sites in one job.

Determine Template Usage

Before you start this process, you should check to see what sites were created from the template. You can do this using the Determine Template Usage feature. This will give you visibility over the sites that will be impacted by the change, so you can decide what sites, if any, need to be excluded from the Sync. It will also enable you to establish if anyone needs to be notified regarding the impending changes.

  1. Navigate to the Template home page and click Settings | Site Settings.
  2. Click Determine Template Usage.
  3. Click Locate.

    The list of sites that were created using the Template will be returned.

Download the PowerShell Zip

  1. Login into your server and create the following folder location:
    c:\BrightWork\DesignSyncScripts
  2. Click here to download the BrightWork Multi-Project Template Design Sync PowerShell.
  3. Extract the zip file to the DesignSyncScripts folder.

Run Downloaded Script

The PowerShell Script provided by BrightWork does the following tasks in sequence:

  1. Checks if the URL points to a valid BrightWork Template with sites bound to it.
  2. Checks if a PowerShell script has already been generated for this template, and if so, provides you with an opportunity to either reuse the existing file; rename it; or delete it.
  3. Creates a new PowerShell script that will be used to sync the sites that are bound to the template.
    The generated script uses the template title, for example, if the template was called Project Structured, the script would be called
    SyncProjectsBasedOnTemplateProject Structured.ps1.

To run the downloaded script:

  1. Click Start, right-click on SharePoint Management Shell and click Run as administrator.
  2. Change the folder to the location of the PowerShell (ps1) script
    cd C:\BrightWork\DesignSyncScripts (or the folder you have downloaded the script to).
  3. Run the below command using the template URL instead of the URL in the command.
    .\GenerateDesignSyncScriptForSpecifiedTemplate.ps1 http://server/sites /templates/templateName
    This will generate a script and save it to the C:\BrightWork\DesignSyncScripts folder.

Edit Generated Script

If you do not want to sync all the sites identified as bound to the template, you can edit the script and comment them out.

  1. Open the script in a code editor like Notepad.
  2. Search for #Comment out.
  3. Enter a # for any site you do not want to sync.
  4. Save and exit the file.

Run Generated Script

  1. Return to the open SharePoint Management Shell window and run the below command, replacing the bold sections with the template title.
    .\SyncProjectsBasedOnTemplateTemplateTitle.ps1 | Out-File -filePath C:\BrightWork\DesignSyncScripts\TemplateTitleTemplateLog.txt
    For example, if the template was called Project Structured (ProjStr), the line to run would be as below.
    .\SyncProjectsBasedOnTemplateProject Structured (ProjStr).ps1| Out-File -filePath C:\BrightWork\DesignSyncScripts\ Project Structured (ProjStr)TemplateLog.txt
  2. Exit the SharePoint Management Shell.

About the Log File

The generated log file contains the below information about every site synced. More information about the nature of these messages can be found in the Site Sync Log list in every site that was synced.

  • No of Errors, i.e. items that the sync was unable to copy
  • No of Warnings, i.e. changes that were skipped due to the design sync settings
  • No of Information messages, i.e. major changes that were synced such as adding and deleting lists
  • Time taken to sync

Remove Bindings

Any site created from a BrightWork template using the BrightWork site creation process is automatically bound to that template. Once a site is bound to a template, the binding cannot be removed via the UI unless the template is deleted.

This section describes how to use SharePoint Designer or a PowerShell script to remove the binding on a site-by-site basis.

Reasons why you might want to do this include:

  • Easily migrate to a newer version of the template
  • Add more process to a particular project

Remove Bindings with SharePoint Designer

Before proceeding with this task, ensure that SharePoint Designer 2010 is installed on your machine. It is available as a free download from Microsoft.

  1. Navigate to the Project site you want to unbind from a template.
  2. Click Site Actions | Edit in SharePoint Designer.
  3. Click Site | Site Options on the SharePoint Designer ribbon.
  4. Select the vti_bw_sitetemplatebinding property in the Site Options dialog and click Remove to delete the binding.
  5. Click OK to close the window.

Remove Bindings with a PowerShell Script

Before proceeding with this task, you should have the URLs of the sites that you want to unbind easily accessible so you can copy and paste them as needed.

To download the BrightWork Template Design Sync Unbind PowerShell script:

  1. Login into your server and create the following folder location:
    c:\BrightWork\DesignSyncScripts
  2. Click here to download the BrightWork Template Design Sync Unbind PowerShell.
  3. Extract the zip file to the DesignSyncScripts folder.

To run the BrightWork Template Design Sync Unbind PowerShell script:

  1. Click Start, right-click on SharePoint 2010 Management Shell and click Run as administrator.
  2. Change the directory to the location of the ps1 script
    cd C:\BrightWork\DesignSyncScripts
  3. Run the below command using the site URL instead of the URL in the command.
    .\RemoveTemplateBindingFromProjectWeb.ps1 http://<server>/sites/<sitecollection>/projects/example

If the process was successful, you should see a success message similar to the below.

Was this article useful?

Back to Top