I need to create 100+ site collections in SP2013. I have a PowerShell script and XML file to achieve this (and is working).
However, marketing want to brand and change the look of the Team Sites - I'm just going to use the 'Grey' composed look for now.
(Ultimately I would like to include theme/logo/look change in initial site collection script) But for now I'm hoping someone can shed light on the error described.
The script I have to do this (i.e. it changes composed look retrospectively)
doesn't work - Exception Calling "ApplyTheme" with "4" arguments(s): "The Web application at http://_catalogs/theme/15/Palette032.spcolor could not be found. Verify...."
The http address is clearly incorrect but I am using ServerRelativeURL? The spcolor http://xxx.xxxxx.org.uk/_catalogs/theme/15/Palette032.spcolo
r file exists
The script is:
$themeName = "Grey"
$SPSite = Get-SPSite "http://xxx.xxxxx.org.uk"
foreach ($SPWeb in $SPSite.AllWebs)
{
$SPWeb.allowunsafeupdates = $true
$fontSchemeUrl = $SPWeb.ServerRelativeUrl + ""
$themeurl = $SPWeb.ServerRelativeUrl + "/_catalogs/theme/15/Palette032.spcolor"
$imageUrl = $SPWeb.ServerRelativeUrl + ""
**$SPWeb.ApplyTheme($themeUrl, $fontSchemeUrl, $imageUrl, $false);**
Write-Host "Set" $themeName "at :" $SPWeb.Title "(" $SPWeb.Url ")"
$SPWeb.Update()
$SPWeb.allowunsafeupdates = $false
$SPWeb.Dispose()
}
$SPSite.Dispose()
What am I missing? Any help is greatly appreciated.