Archives For November 30, 1999


Consider this scenario: You create a new web and add several apps. Next, you make some master page modifications and choose the “Reset All Subsites” option when applying the master page. This prompts SharePoint to reset all MasterUrl and CustomMasterUrl properties to point to the root web. Because all of our apps are running in their own App-Web (Aka sub-site) these sites are reset too. So now when are apps are rendered the master page it calling to the root web for its masterpage. This results in error because the app is not allowed to call outside of its own web. (Some scenarios allow cross-site calls).

 

To fix this we need to rewrite the app master page URL. We can do this for all apps using PowerShell.


$appWebs = (Get-SPSite -Identity <YourSiteCollectionURL> -Limit All).AllWebs | ?{$_.Url -match "<YourAppURL>"} #Your app URL should be company-app.com, etc
foreach ($app in $appWebs) {
$masterUrl = $app.ServerRelativeUrl + "/_catalogs/masterpage/Seattle.master"
$app.MasterUrl = $masterUrl
$app.Update()
}

We can now access the configuration pages within our apps.

 

{Kam}


Need to cycle IIS on all of your SharePoint servers? There are a couple ways to do it in 1-2 lines of PowerShell.

Option 1 (Requires SharePoint Admin shell or the Microsoft.SharePoint.PowerShell add in to be loaded)

Get-SPServer | ?{$_.Role -ne "Invalid"} | %{iisreset $_.Address}

Option 2 (Can be run from any POSH shell)

$servers = @("sp1","sp2","sp3")
$servers | %{iisreset $_}

Option 2 requires that you put your servers into an array manually. This could also be run on a single line.

$servers = @("sp1","sp2","sp3"); $servers | %{iisreset $_}

Happy POSHing!

Great post on how to use POSH and CSOM to work with SharePoint Online!!


When you are working with Search in SharePoint 2013 you no longer have the luxury of using the GUI to modify search topology. Now we have to directly modify a topology using a clone in PowerShell.
At a high level we have the:

  • Search Service Application
  • Search Topology
  • Search Instance on each Server in the search topology

We also have the following components:

  • Admin
  • Crawler
  • Content Processing
  • Analytics Processing
  • Query Processing
  • Index

When we want to change the topology of a search service application such as:

  • Change the index location on the index component
  • Add a index replica on another server in the farm
  • Add additional components to other servers in the farm
  • Remove components

Continue Reading…