This guide will show you how to manage SharePoint Designer settings for a SharePoint web application using both the SharePoint object model and PowerShell.
Table of Contents:
Using SharePoint Designer
Using SharePoint Object Model
Using PowerShell
What is SharePoint Designer?
Microsoft SharePoint Designer, formerly known as Microsoft Office SharePoint Designer, is a discontinued HTML editor freeware for creating or modifying Microsoft SharePoint sites, workflows, and web pages. It’s part of the Microsoft SharePoint family of products.
SharePoint Designer is a web and application design program used to build and customize SharePoint sites and applications. With SharePoint Designer, you can create data-rich pages, build powerful workflow-enabled solutions, and design the look and feel of your site. It provides a unique site authoring experience by offering one place where you can create a site, customize its components, design the logic of the site around a business process, and deploy the site as a packaged solution, all without writing a line of code.
SharePoint Designer Settings for SharePoint Web Application
SharePoint Designer Settings for a SharePoint Web Application can be configured using three primary methods:
SharePoint Designer
SharePoint Object Model
PowerShell
Let's explore each of these methods:
1. Using SharePoint Designer
SharePoint Designer allows users to configure various settings for a SharePoint Web Application, including but not limited to:
Site structure and layout.
Workflows and automation.
Data views and forms.
STEP 1: On your Windows desktop screen, click Start >> Administrative Tools >> SharePoint 2013 Central Administration.
Run it as an administrator to have the elevated privileges.
STEP 2: You will see the screenshot given below. Central Admin is configured under the categories given above.
Click on "General Application Settings".
STEP 3: Go to "SharePoint Designer".
Click "Configure SharePoint Designer Settings".
You will see the screen given below.
Web Application:
Select a Web Application, where you want to configure SharePoint designer settings.
Allow SharePoint Designer to be used in this web application:
Here, you can allow or disallow the users to use SharePoint designer on the sites of the selected Web Application.
Allow Site Collection Administrators to detach pages from the site template:
Here, you can allow or disallow SharePoint admins to detach the pages from the site definition, using SharePoint Designer.
Allow Site Collection Administrators to customize master pages and layout pages:
Here, you can allow or disallow SharePoint admins to customize the master pages and page layouts from the site definition, using SharePoint Designer.
Allow Site Collection Administrators to see the URL structure of their Website:
Here, you can allow or disallow SharePoint admins to see the URL structure of their Website, using SharePoint Designer.
2. Using SharePoint object model
The SharePoint Object Model is a set of programming interfaces and classes provided by Microsoft for interacting with and managing SharePoint resources programmatically. Developers can use programming languages like C# or PowerShell to access and manipulate SharePoint objects.
Using the SharePoint Object Model, developers can write custom code to configure settings for a SharePoint Web Application. This includes tasks such as:
Creating or modifying site collections, sites, and lists.
Managing user permissions.
Configuring features and properties.
STEP 1: Open Visual Studio and go to File => New => Project.
STEP 2: Select the Console Application template from the installed templates.
STEP 3: Enter the Name and click on OK.
Add the following assembly:
Microsoft.SharePoint.dll
Add the following namespaces.
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint;
Program.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint;
namespace DesignerSettings
{
class Program
{
static void Main(string[] args)
{
SPWebApplication webApp = SPWebApplication.Lookup(new Uri("https://example.com/"));
// Enable or disable SharePoint Designer settings
webApp.AllowDesigner = false;
// Enable SharePoint Designer
webApp.AllowRevertFromTemplate = false;
// Enable Detaching Pages from the Site Definition
webApp.AllowMasterPageEditing = false;
// Enable Customizing Master Pages and Layout Pages
webApp.ShowURLStructure = false;
// Enable Managing of the Web Site URL Structure
// Update the changes
webApp.Update();
}
}
}
3. Using PowerShell
PowerShell scripts can be written to configure SharePoint Web Application settings. This may involve tasks such as:
Configuring authentication settings.
Managing service applications.
Setting up custom features.
Here’s how:
$webApp = get-spwebapplication "https://anavijai.com/"
# Enable or disable SharePoint Designer settings
$webApp.AllowDesigner = $false # Enable SharePoint Designer
$webApp.AllowRevertFromTemplate = $false # Enable Detaching Pages from the Site Definition
$webApp.AllowMasterPageEditing = $false # Enable Customizing Master Pages and Layout Pages
$webApp.ShowURLStructure = $false # Enable Managing of the Web Site URL Structure
# Update the changes
$webApp.Update()
Conclusion
SharePoint Designer provides a user-friendly interface for non-developers to configure settings, while the SharePoint Object Model and PowerShell offer more flexibility for developers and administrators to automate and customize SharePoint configurations based on specific requirements. Each method has its strengths, and the choice of which to use depends on the complexity of the task and the skills of the person performing the configuration.
That’s it! You now know how to manage SharePoint Designer settings for a SharePoint web application using the SharePoint object model and PowerShell.
Happy coding!
Comments