Error: Specified value is not supported for the domainname parameter.

I came across the below error when trying to create a new web application via PowerShell against a 2013 farm.

“Specified value is not supported for the domainname parameter error when creating web apps”

This appears to have been caused by the machine loosing connectivity to the domain so even though my server was domain joined it was not connected.  In my case this was due to the DNS service failing, re-starting the DNS service allowed me to create the web app.

Deleting Site Collections in Office 365

By default deleting a site collection in Office 365 just moves the site collection to the recycle bin for 30 days, but there is not an option in the admin screen to remove it from the recycle bin.

This is fine, unless you want to use the same url for a new site collection. In this instance you will need to use PowerShell to remove the site collection from the recycle bin. To do this you will need to install the following.

PowerShell v3.0
http://www.microsoft.com/en-us/download/details.aspx?id=34595

Microsoft Online Services Sign-In Assistant for IT Professionals RTW
http://www.microsoft.com/en-us/download/details.aspx?id=35588 or http://www.microsoft.com/en-us/download/details.aspx?id=39267

SharePoint Online Management Shell
http://www.microsoft.com/en-us/download/details.aspx?id=35588

Once this is done open up the online management shell and enter the following.
Connect-SPOService “[Full Admin URL]” -credential “Online User Id”
Remove-SPODeletedSite “[Full URL]”

SharePoint 2013: Creating a Publishing Page and assigning a page layout using PowerShell

The following PowerShell can be used to create a publishing page and assign a page layout.

#Get SPWeb
$spWeb = Get-SPWeb(“Site URL”);
#Get Publishing Web
$pubWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($spWeb)
#Finds the appropriate page layout
$pl = $pubWeb.GetAvailablePageLayouts() | Where { $_.Name -eq “Page Layout Name”}
$pages = $pubWeb.GetPublishingPages();
#Create the page;
$page = $pages.Add(“Page Name”, $pl)
#Check in Page
$page.CheckIn(“Created by PowerShell”);
#Dispose of SPWeb
$spWeb.Dispose();

SharePoint 2013: PowerShell to update a term sets Submission Policy

The following PowerShell can be used to update a terms sets submission policy to open or closed.

#Connect to Central Admin
$Session = new-object Microsoft.SharePoint.Taxonomy.TaxonomySession(“Central Admin URL”)

#Connect to Managed Metadata Service
$Store = $Session.TermStores[“Managed Metadata Service Name”]
#Get the group
$Group = $Store.Groups[“Group Name”];
#Get the Term Set
$TermSet = $Group.TermSets[“Term Set Name”];
#Update the Is Open property
$TermSet.IsOpenForTermCreation = $true;

#Commit changes
$Store.CommitAll();

SharePoint 2013 Error: The filtering process has been terminated

I had just completed a PowerShell scripted deployment of a SharePoint farm and was just performing the final checks when I noticed the following error in the crawl logs.

The filtering process has been terminated

This turned out that because in the PowerShell script I had specified that the SharePoint installation location should be different to the default location.  The SharePoint installation routine had not associated the correct permissions for the WSS_WPG group.

In my instance I had specified that SharePoint should be installed onto a non system disk and I had also specified different directories for indexes and logs.

To fix this I added the WSS_WPG with full control to the following directories.

%:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications
c:\Windows\Temp
%:\SharePoint\Index

Once the correct permissions had been applied I ran a full crawl and no longer received this error.