With SharePoint 2016 quite a few new PowerShell cmdlets have arrived. In this post I’ve included a quick overview of all the new commands.

Before I’m going into all the command a few new bits in SharePoint 2016:

Site Master

SharePoint 2016 has new functionality for Site Template deployment called “Site Masters”. These are master Site Templates, configured by a SharePoint Administrator, that allow quick deployment of a Site Template when a new SharePoint Site is requested.

Creating new Site Masters is an easy task and all done through PowerShell in a mater of seconds, using the SharePoint Management Shell, input the WebTemplateId and the Content Database to store it in using the New-SPSiteMaster cmdlet.

The new -CreateFromSiteMaster on the New-SPSite then creates the site from the created site master.

SharePoint Services

Ok, services aren’t new, but the way it’s now possible to control the services with PowerShell is. Quite a few Cmdlets have been added that make your job a lot easier.

 

Ok, ready for the overview of all the new Cmdlets?

Add-DatabaseToAvailabilityGroup

The Add-DatabaseToAvailabilityGroup cmdlet adds one or more databases from a SharePoint farm into an availability group in SQL Server.

Copy-SPAccessServicesDatabaseCredentials

The Copy-SPAccessServicesDatabaseCredentials cmdlet copies credentials of an application from one logical server to another.

Copy-SPSideBySideFiles

The Copy-SPSideBySideFiles Cmdlet copies side by side files. In SharePoint Server 2016, zero down time in-place upgrade is available.

If the PSConfig.exe file is used during an upgrade and copy SideBySide files fail, you can use the Copy-SPSideBySideFiles cmdlet to copy SideBySide files. If you use Windows PowerShell scripts instead of PSConfig.exe to perform an upgrade, please run the Copy-SPSideBySideFiles cmdlet to copy SideBySide files.

Disable-SPWebTemplateForSiteMaster

The Disable-SPWebTemplateForSiteMaster Cmdlet disables the site template in the farm.

So to disable the team site template run the following command:

Disable-SPWebTemplateForSiteMaster -Template STS#0 -CompatibilityLevel 15

The Enable-SPWebTemplateForSiteMaster cmdlet  will undo this action.

Enable-SPWebTemplateForSiteMaster

The Enable-SPWebTemplateForSiteMaster creates a template for a site master.

Enable-SPWebTemplateForSiteMaster -Template STS#0 -CompatibilityLevel 15

The Disable-SPWebTemplateForSiteMaster cmdlet will undo this action.

 

Export-SPAccessServicesDatabase

The Export-SPAccessServicesDatabase cmdlet exports the Access Database into a Bacpac package.

Export-SPTagsAndNotesData

The Export-SPTagsAndNotesData cmdlet exports the SharePoint Newsfeed tags and notes.

Export-SPTagsAndNotesData -Site http://site.mycorp.com -FilePath C:\TagsAndNotes.zip

Get-AvailabilityGroupStatus

The Get-AvailabilityGroupStatus cmdlet returns one or more objects representing the availability groups known to the SharePoint farm.

Get-SPAppStoreWebServiceConfiguration

The Get-SPAppStoreWebServiceConfiguration cmdlet returns properties of a SharePoint Store app.

Get-SPConnectedServiceApplicationInformation

The Get-SPConnectedServiceApplicationInformation cmdlet returns the health of the service application proxy.

 

Get-SPInsightsConfig

The Get-SPInsightsConfig cmdlet returns the uploader.xml and Microsoft.Office.BigData.DataLoader.exe.config files from the Configuration database

Get-SPMicrofeedOptions

The Get-SPMicrofeedOptions cmdlet returns the feed cache settings for the current user profile application.

Get-SPService

The Get-SPService cmdlet gets a service in the farm. It is quite amazing that this cmdlet didn’t already exist before.

All you need to supply is the name of the service:

Get-SPService -Identity “Microsoft SharePoint Server Diagnostics Service”

Get-SPSiteMaster

The cmdlet Get-SPSiteMaster retunrs the site master of a content database that is supplied. Simply add -ContentDatabase WSS_Content to the cmdlet and the site master is returned.

Site master information typically includes:

  • ContentDatabase
  • SiteId
  • TemplateName
  • Language
  • CompatibilityLevel
  • FeaturesToActivateOnCopy

Get-SPWebTemplatesEnabledForSiteMaster

The Get-SPWebTemplatesEnabledForSiteMaster cmdlet returns a list of site master web templates.

Import-SPAccessServicesDatabase

The Import-SPAccessServicesDatabase imports the Access Database into a Bacpac package as created by the Export-SPAccessServicesDatabase cmdlet

Move-SPSocialComment

The Move-SPSocialComment cmdlet moves comments from one page to another.

$upaProxy = Get-SPServiceApplicationProxy 1232b6f7-b9ff-99ad-0cd0-fg1g67h981aq

Move-SPSocialComments -ProfileServiceApplicationProxy $upaProxy -OldUrl “http://mycorp/Pages/oldtest.aspx” -NewUrl “http://mycorp/Pages/newtest.aspx”

New-SPSiteMaster

The New-SPSiteMaster cmdlet  creates a site master. These are the new kind of web templates/site definitions that live within the content databases.

Remove-SPActivityItems

The Remove-SPActivityItems cmdlet removes activity events from the published and consolidated tables.

Remove-SPCentralAdministration

The Remove-SPCentralAdministration cmdlet removes the SharePoint Central Administration web site from the local server.

Remove-SPSiteMaster

The Remove-SPSiteMaster cmdlet removes a site master from a content database.

Reset-SPSites

The Reset-SPSites cmdlet synchronizes the content database with the configuration database of the farm.

The Reset-SPSites cmdlet synchronizes the content database with the configuration database of the farm with respect to what site collections actually exist in the content database.

It also ensures that all site collections in the content database are registered in the configuration database and removes any site collection references in the configuration database if the site collection does not exist in the content database.

Set-SPAppStoreWebServiceConfiguration

The Set-SPAppStoreWebServiceConfiguration cmdlet Sets properties of a SharePoint Store app.

Use the Set-SPAppStoreWebServiceConfiguration cmdlet to set the product type (On-Premises or Online) and the version used to access the SharePoint Store when SharePoint is configured to access the .

Note: This cmdlet is not intended for the ITPro audience.

Set-SPDefaultProfileConfig

The Set-SPDefaultProfileConfig cmdlet changes the MySitesPublicEnabled property of the User Profile Application Proxy.

Set-SPServer

The Set-SPServer cmdlet hanges the role of the server. So similar to the installer you can now set the SharePoint role  to any of the following options:

  • Invalid
  • WebFrontEnd wiz3
  • Application
  • SingleServer
  • SingleServerFarm
  • DistributedCache
  • Search
  • Custom

Set-SPServer -Role SingleServerFarm

 

Start-SPService

The Start-SPService cmdlet enables a service in the farm.

Stop-SPService

The Stop-SPService cmdlet disables a service in the farm.

Update-SPMicrofeedOptions

The Update-SPMicrofeedOptions cmdlet updates the feed cache settings for the current user profile application.

Upgrade-SPProfileServiceApplication

The Upgrade-SPProfileServiceApplication cmdlet upgrades User Profile Service and its related profile and social store.

 

Advertisements