Board of Directors Site

Doug Ware edited this page Aug 18, 2016 · 2 revisions

Overview

The Board of Directors Site was created from an original Fab40 site that was migrated to SharePoint 2013 and massaged until it worked.

The package demonstrates provisioning of:

  • Lists
  • Document Templates
  • Workflows
  • Navigation
  • Feature removal

It is possible to recreate the package if you have access to a site where this package is installed by using individual Creator Builders and identifying the specific elements to include in the package. On the other hand it is much easier to use the Get-WebCreator cmdlet to create a package by comparing a site that has customizations to a clean site without any customizations and then supplement the result by fetching the individual files needed with Get-FileCreatorAndFolders.

To use this you will need access to a SharePoint 2013, SharePoint Online, or SharePoint 2016 tenant where you have the ability to create site collections. To follow all of the steps in this article you will need three seperate site collections.

(1) A new Team site with no content or customizations that we will call the base site.

(2) A new Team site with no content or customizations that we will call the source site.

(3) A new Team site with no content or customizations that we will call the target site.

(4) A directory where your package and related files are stored

Deploy the Sample to the Source Site

(1) Download the package from here: Board of Directors Site and extract the files.

(2) Next open PowerShell ISE and enter the following script (substituting your own values where required):

Note: Include the -Online switch for New-SPClientContext in all samples below if you are using SharePoint Online

$man = New-IQAppManifest -JSONFilePath "[PathToTheSamplePackageFolder]\manifest.json"

$user = "[USERNAME]"
$password = "[PASSWORD]"
$source = "[URL_TO_SOURCE_SITE]"

$ctx = New-SPClientContext -SiteURL $source -UserName $user -Password $password

Install-IQAppManifest -ClientContext $ctx -Web $ctx.Web -AppManifest $man -VerboseNotify

(3) Run the script As the Install-IQAppManifest runs, you will see detailed output that tells you what is happening. When it finishes, open your site and have a look!

Create a New Package from the Source Site

(1) Return to PowerShell ISE and enter the following (substituting your own values where required):

Note: Include the -Online switch for New-SPClientContext in all samples below if you are using SharePoint Online

$user = "[USERNAME]"
$password = "[PASSWORD]"

$source = "[URL_TO_SOURCE_SITE]"
$base = "[URL_TO_BASE_SITE]"

$man = New-IQAppManifest
$man.BaseFilePath = "[OUTPUT_PATH]"
$man.ManifestName = "Board of Directors Site"
Save-IQAppManifest $man

$ctxSource = New-SPClientContext -SiteURL $source -UserName $username -Password $password
$ctxBase = New-SPClientContext -SiteURL $base -UserName $username -Password $password

Get-WebCreator $ctxSource $ctxBase -AppManifest $man -VerboseNotify 

Get-FileCreatorAndFolders -ClientContext $ctxSource -Web $ctxSource.Web -FileWebRelativeUrl "/workflows/create discussion/create discussion.xoml" -AppManifest $man -VerboseNotify
Get-FileCreatorAndFolders -ClientContext $ctxSource -Web $ctxSource.Web -FileWebRelativeUrl "/workflows/create discussion/create discussion.xoml.wfconfig.xml" -AppManifest $man -VerboseNotify
Get-FileCreatorAndFolders -ClientContext $ctxSource -Web $ctxSource.Web -FileWebRelativeUrl "/workflows/create meeting minutes/create meeting minutes.xoml" -AppManifest $man -VerboseNotify
Get-FileCreatorAndFolders -ClientContext $ctxSource -Web $ctxSource.Web -FileWebRelativeUrl "/workflows/create meeting minutes/create meeting minutes.xoml.wfconfig.xml" -AppManifest $man -VerboseNotify
Get-FileCreatorAndFolders -ClientContext $ctxSource -Web $ctxSource.Web -FileWebRelativeUrl "/meeting minutes/forms/meeting minutes.docx" -AppManifest $man -VerboseNotify
Get-FileCreatorAndFolders -ClientContext $ctxSource -Web $ctxSource.Web -FileWebRelativeUrl "/sitepages/boardhome.aspx" -AppManifest $man -VerboseNotify
Get-FileCreatorAndFolders -ClientContext $ctxSource -Web $ctxSource.Web -FileWebRelativeUrl "/siteassets/fab40boardlogo.jpg" -AppManifest $man -VerboseNotify
Get-FileCreatorAndFolders -ClientContext $ctxSource -Web $ctxSource.Web -FileWebRelativeUrl "/lists/calendar/dispform.aspx" -AppManifest $man -VerboseNotify
Get-FileCreatorAndFolders -ClientContext $ctxSource -Web $ctxSource.Web -FileWebRelativeUrl "/default.aspx" -AppManifest $man -VerboseNotify
Get-FileCreatorAndFolders -ClientContext $ctxSource -Web $ctxSource.Web -FileWebRelativeUrl "/lists/calendar/newform.aspx" -AppManifest $man -VerboseNotify
Get-FileCreatorAndFolders -ClientContext $ctxSource -Web $ctxSource.Web -FileWebRelativeUrl "/lists/calendar/editform.aspx" -AppManifest $man -VerboseNotify

Save-IQAppManifest $man

(2) Run the script and examine the output as it runs - it should find a few fields, content types, and lists.

(3) Navigate to [OUTPUT_PATH] and examine its contents including the contents of manifest.json.

Tip: You can view the formatted output in PowerShell using

ConvertTo-Json -InputObject $man -Depth 6

or send it to the clipboard as follows

ConvertTo-Json -InputObject $man -Depth 6 | clip

Test the New Package

(1) Return to PowerShell ISE and enter the following (substituting your own values where required):

Note: Include the -Online switch for New-SPClientContext in all samples below if you are using SharePoint Online

$user = "[USERNAME]"
$password = "[PASSWORD]"
$target = "[URL_TO_TARGET_SITE]"

$man = New-IQAppManifest -JSONFilePath "[OUTPUT_PATH]\manifest.json"

$ctxTarget = New-SPClientContext -SiteURL $target -UserName $user -Password $password

Install-IQAppManifest -ClientContext $ctxTarget -Web $ctxTarget.Web -AppManifest $man -VerboseNotify

(2) Run the script and examine the output as it runs.

(3) Navigate to [URL_TO_TARGET_SITE] and see that it matches the source site.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.