Vue lecture

Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.
✇MG

How to Create an Emailable Exchange Distribution List with Internal and External Contacts?

Scenario:

If you need a distribution list in Exchange that includes both internal organization contacts and external contacts—without requiring external users to be invited as guest accounts—there’s a simple way to achieve this.

In Exchange Online, external contacts are referred to as Mail Contacts. These allow you to add external email addresses to your organization’s address book, making them available for inclusion in distribution lists. By leveraging Mail Contacts, you can create a fully functional distribution list that includes both internal users and external recipients while keeping everything manageable within Exchange.

Managing email distribution lists efficiently is crucial for organizations that need to communicate with both internal and external contacts. While Exchange Online allows us to create Mail Contacts programmatically using PowerShell scripts or the Exchange Online Management API, automating this process is key—especially when integrating it with Dynamics 365 Marketing Lists.

The Automation Challenge

In my case, I wanted to automatically add new contacts from a specific Dynamics 365 Marketing List to a corresponding Exchange Distribution List. Initially, I considered using Power Automate to invoke a PowerShell script, but that introduced additional complexities:

  • Using Power Automate to trigger an Azure Automation Runbook
  • Managing authentication and execution permissions
  • Handling execution timing and monitoring

A More Efficient Approach: Logic Apps

Instead of relying on Power Automate, I found a better and more streamlined approach—using Azure Logic Apps. Unlike Power Automate, Logic Apps offer built-in functionality to create and execute Runbook Jobs directly within Azure Automation.

What This Blog Covers

In this post, I’ll walk you through:
✅ Setting up an Azure Automation Account
✅ Creating a Runbook to execute a PowerShell script that adds Mail Contacts
✅ Using Azure Logic Apps to trigger the Runbook
✅ Handling authentication across these services

By the end, you’ll have an end-to-end automation setup that seamlessly adds external contacts to Exchange Distribution Lists as soon as they join a Dynamics 365 Marketing List—without requiring manual intervention.

Let’s dive in! 🚀

Step 1: Set up the Azure Automation Account

  1. Log in to Portal Azure https://portal.azure.com/ and in the search box, type Automation Accounts


2. Click on Create, Select your Subscription and Resource group, and type in the Automation Account Name

2. Then click the Advanced Tab, and on the Managed Identities, select User Assign; we will set up the User Managed Identity in the next steps.

3. Click Review and Create.

Step 2: Setup the User Managed Identity

A common challenge for developers is the management of secrets, credentials, certificates, and keys used to secure communication between services. Managed identities eliminate the need for developers to manage these credentials.

A common challenge for developers is the management of secrets, credentials, certificates, and keys used to secure communication between services. Managed identities eliminate the need for developers to manage these credentials.

While developers can securely store the secrets in Azure Key Vault, services need a way to access Azure Key Vault. Managed identities provide an automatically managed identity in Microsoft Entra ID for applications to use when connecting to resources that support Microsoft Entra authentication. Applications can use managed identities to obtain Microsoft Entra tokens without having to manage any credentials.

So Let’s see how to setup the account with the Required Permissions!

  1. On the Search, Type Managed Identities

2. Click Create, Select the subscription, Resource group, and give it a name

3. Then Press Review and Create

4. Open the automation account that we have created in Step no. 1

5. Search for Identity, open the link, select user assigned, and click Add.

6. Add the managed identity that we have just created.

7. Next comes setting the Permissions for the Managed Identity, so go back and open the Managed Identity.

8. Go to Azure Role Assignments and add the Automation Contributor Role; this is required to enable the Logic app to execute the RunBook (we will be creating this in the next step) on the automation account.

9. Grant the Exchange.ManageAsApp API permission for the managed identity to call Exchange Online, Unfortunately, this step can’t be done through the Azure / Entra Portal, so we will be using Graphy API Explorer to achieve this.

Get the Managed Identity’s Object ID

Get Exchange Online Service Principal ID

Open Grap API Explorer, Login ,and run the below query and grap the Exchange online service Principal ID

Method: Get

https://graph.microsoft.com/v1.0/servicePrincipals?$filter=appId eq '00000002-0000-0ff1-ce00-000000000000'

Assign the Exchange.ManageAsApp Permission

Using Graph Explorer API again, use the below to assign the Exchange.ManageAsApp Permission

POST https://graph.microsoft.com/v1.0/servicePrincipals/{MANAGED_IDENTITY_OBJECT_ID}/appRoleAssignments
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json

{
  "principalId": "{MANAGED_IDENTITY_OBJECT_ID}",
  "resourceId": "{EXCHANGE_ONLINE_SERVICE_PRINCIPAL_ID}",
  "appRoleId": "dc50a0fb-09a3-484d-be87-e023b12c6440"
}

10. Assign Microsoft Entra roles to the managed identity; you will need to assign the Exchange Administrator Role

In the Search type role and select Microsoft Entra Roles and administrators

11. Open Exchange Administrator Assignments and add the user Managed Identity by clicking the Add Assignments Button .. Global administrator privileges will be required for this.

Step 4: Import Exchange Management Modules

  1. Open the Automation Account that we have created in step 1
  2. Navigate to Shared Resources -> Modules
  3. Click Add Module

4. Click Browse from gallery

  1. Open the Automation Account
  2. Navigate to Process Automation -> Runbooks
  3. Search for PackageManagement and select and choose the Runtime Version 5.1

4. Repeat for Add PowerShellGet and choose Runtime Version 5.1

5. Repeat for ExchangeOnlineManagement and choose Runtime Version 5.1

Step 5: Create a runbook in Azure Automation

  1. Open the Automation Account
  2. Navigate to Process Automation -> Runbooks
  3. Click on Create a runbook. Make sure you are using Runtime Version 5.1 because PowerShell works only for this Version

4. Open the Run Book and click Edit in Portal.

5. Paste the below Powershell Script that connects to exchange

//The below piece of code sets parameters on the run book so that when called from a logic app we can pass these parameters to the run book.
param (
    [string]$MailContactName,
    [string]$MailContactEmail,
    [string]$DistributionList
)
// Connects to Exchange online via the managed Identity that have been setup in step 3
Connect-ExchangeOnline -ManagedIdentity -Organization Organisationdomain.onmicrosoft.com -ManagedIdentityAccountId {Managed Account Identity ID}

//Creates a mail contact in Exchange
New-MailContact -Name $MailContactName -ExternalEmailAddress $MailContactEmail

//Add mail Contact to the Distribution List
Add-DistributionGroupMember -Identity $DistributionList -Member $MailContactEmail

6. After that Click Save and Publish

7. You can then test the runbook by clicking the Test Pane on the Edit in Portal Screen of the runbook, entering the parameters and clicking start.

Step 5: Create the Logic App

So the Logic app will be created in a schedule and can query any enterprise connector like dataverse and then call the runbook that has been created in Step 5

  1. From the Azure Portal , Look for Logic Apps and click Add
  2. Choose the Hosting Plan, and here you can select the Consumption plan

3. Select the subscription, the Resource Group and add the logic app name

4. Click Review and Create and then Create

5. On the created Logic app, search for Identity, Navigate to user assigned and add the Managed identity created in step 2

5. Navigate to the Logic app designer. On the Add Trigger step, choose schedule and set the recurrence schedule. Then, add Action and look for Create Job and select the one under Azure Automation

6. Set the Connection Name and Choose the Authentication Type as Logic Apps Managed Identity

7. Select the Subscription, Resource Group, Automation Account, Run book and pass the required Parameters

8. Save and test the Logic App

Resources:

https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview

✇Ganesh Sanap Blogs

How to Hide a SharePoint List or Library from the UI?

SharePoint provides powerful collaboration features to users including lists and libraries, and while transparency is crucial, there are instances where hiding a list or library becomes essential for optimizing user experiences and/or maintaining data integrity. Example: Power Apps often relies on SharePoint lists as data sources. However, not all lists are meant for end users to view directly. By hiding lists or libraries from SharePoint UI, you can prevent end users from editing the data directly from SharePoint lists.

In this blog post, we’ll explore how to hide a SharePoint list or document library using PnP PowerShell & CLI for Microsoft 365 and view all hidden lists/libraries in SharePoint site using PnP PowerShell & CLI for Microsoft 365.

Hiding a SharePoint List or Library using PnP PowerShell

You can use below PnP PowerShell script to hide a SharePoint online list or document library from SharePoint UI (Site Contents page):

# SharePoint Online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint online site URL (e.g https://contoso.sharepoint.com/sites/work)"

# Display name of SharePoint online list or document library
$listName = Read-Host -Prompt "Enter the display name of your SharePoint list or library (e.g My List)"

# Connect to SharePoint online site
Connect-PnPOnline -url $siteUrl -Interactive

# Hide SharePoint online list from UI
Set-PnPList -Identity $listName -Hidden $true

# Disconnect SharePoint online connection
Disconnect-PnPOnline

Hide a SharePoint List or Library using CLI for Microsoft 365

Use below CLI for Microsoft 365 script to hide a SharePoint list or document library from SharePoint UI:

# SharePoint Online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint online site URL (e.g https://contoso.sharepoint.com/sites/work)"

# Display name of SharePoint online list or document library
$listName = Read-Host -Prompt "Enter the display name of your SharePoint list or library (e.g My List)"

# Get Credentials to connect
$m365Status = m365 status
if ($m365Status -match "Logged Out") {
m365 login
}

# Hide SharePoint online list or library from UI (Site Contents)
m365 spo list set --webUrl $siteUrl --title $listName --hidden true

# Disconnect SharePoint online connection
m365 logout

View hidden lists/libraries in SharePoint site using PnP PowerShell

You can use below PnP PowerShell script to view all hidden lists and libraries in the given SharePoint site:

# SharePoint Online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint online site URL (e.g https://contoso.sharepoint.com/sites/work)"

# Connect to SharePoint online site
Connect-PnPOnline -url $siteUrl -Interactive

# View all hidden lists/libraries in a SharePoint online site
Get-PnPList | Where-Object {$_.Hidden -eq $true}

# Disconnect SharePoint online connection
Disconnect-PnPOnline

View hidden lists/libraries in SharePoint site using CLI for Microsoft 365

Use below CLI for Microsoft 365 script to view all hidden lists and document libraries in the given SharePoint online site:

# SharePoint Online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint online site URL (e.g https://contoso.sharepoint.com/sites/work)"

# Get Credentials to connect
$m365Status = m365 status
if ($m365Status -match "Logged Out") {
m365 login
}

# Hide SharePoint online list or library from UI (Site Contents)
m365 spo list list --webUrl $siteUrl --properties "Id,Title,Url" --filter "Hidden eq true" | ConvertFrom-Json

# Disconnect SharePoint online connection
m365 logout

Learn more

✇Ganesh Sanap Blogs

Update SharePoint Page Banner Image using PnP PowerShell

Using pages in SharePoint is a great way to share information or any news/announcement in your organization to SharePoint site users. SharePoint site pages can be improved by utilizing banner images in the page title area. Adding banner images to the page title area not only makes the page more visually appealing but also helps to convey the page’s purpose to the user more quickly and effectively.

In this blog post, we will see how to change the SharePoint Page Banner Image using PnP PowerShell.

First of all upload a high quality image in one of the document libraries in your SharePoint site. SharePoint site page banner images in title area look best when they are landscape or 16:9 or greater in aspect ratio, and when they are at least 1 MB in size. Check this Microsoft official documentation for recommended specifications for banner images: Image sizing and scaling in SharePoint modern pages

Then you can use below PnP PowerShell script to update the banner image at the top of the SharePoint online modern page:


# SharePoint online site URL
$siteUrl = "https://contoso.sharepoint.com/sites/wlive"	

# Connect to SharePoint online site  
Connect-PnPOnline -Url $siteUrl -Interactive

# Update SharePoint site page banner image
Set-PnPPage -Identity "Open-Door-Policy" -HeaderType Custom -ServerRelativeImageUrl "/sites/wlive/SiteAssets/work-remotely.jpeg"

Once you run above script successfully, you will find that banner image for your SharePoint site page is updated successfully:

Update SharePoint online modern page banner image in page title area using PnP PowerShell
Update SharePoint Page Banner Image using PnP PowerShell

Learn more

✇Ganesh Sanap Blogs

How to find the Internal name of columns in SharePoint Online?

The internal name of a SharePoint column is a unique name that is automatically generated by SharePoint when a column is created. It is used by SharePoint internally to reference and retrieve the value of a particular column associated with an item or document. The internal name is generated based on the display name you provide but all special characters and spaces will be replaced with Unicode’s by SharePoint. Internal name is generated only once while creating a new column and it cannot be changed even if you change the display name of SharePoint column.

The internal name is not visible to users in the SharePoint user interface by default, but it is commonly used in various scenarios, such as in SharePoint REST APIs, Power Automate flow expressions, Power Apps formulas, PowerShell, etc. to interact with column data programmatically.

Where are Internal names of SharePoint columns used?

  1. Custom Scripts: When creating custom scripts, such as JavaScript or PowerShell, the internal names of columns are required to reference and manipulate the values of the columns while interacting with SharePoint data.
  2. Workflows: In SharePoint Designer workflows or Microsoft Power Automate (formerly known as Microsoft Flow), the internal names of columns are used to reference the values of the columns as inputs or outputs in the workflow actions and in expressions.
  3. Custom Solutions: When building custom solutions, such as SharePoint apps, SharePoint framework (SPFx) web parts, or custom code, the internal names of columns are required to interact with the columns programmatically.
  4. Power Apps: Few of the Power Apps functions like ShowColumns, SortByColumns, etc. requires using internal names of SharePoint columns in formula.
  5. JSON Formatting: Internal name of SharePoint column is required in JSON formatting to reference the column value with [$InternalNameOfColumn] syntax.

How to find the Internal name of a SharePoint column?

Using Modern experience list view

You can use sorting or filtering options from SharePoint online modern experience list view to find the internal name of a SharePoint column. Sort by and Filter by options are supported by most of the column types in SharePoint like Single line of text, Choice, Number, Date and Time, Yes/No (Boolean), Person or Group (single selection), etc.

For this afticle, we will use sorting based on SharePoint choice column as an example:

1. Go to the SharePoint online list for which you want to check the internal name of a column.

2. Click on column name/header from the list view and select either Ascending (A to Z) or Descending (Z to A) option from the popup menu:

Find internal name of SharePoint column by sorting choice column from SharePoint online modern experience list view
Find internal name of SharePoint column by sorting choice column

3. SharePoint will sort the list view based on selection and the browser URL will be changed like:

https://contoso.sharepoint.com/sites/wlive/Lists/InternalNames/AllItems.aspx?sortField=ChoiceColumn&isAscending=false

Where column name (ChoiceColumn) after sortField= is the internal name of your SharePoint choice column.

4. Similarly, when you use Filter by option in SharePoint modern experience to filter the list view based on Date and Time column (named as Start Date), SharePoint changes browser URL like:

https://contoso.sharepoint.com/sites/wlive/Lists/InternalNames/AllItems.aspx?FilterField1=Start_x0020_Date&FilterValue1=2023-04-05&FilterType1=DateTime

Where column name (Start_x0020_Date) after FilterField1= is the internal name of your SharePoint date and time column. Notice _x0020_ in internal column name which is an Unicode encoding of the space character in the display name of date and time column (Start Date).

Using Classic experience List settings page

Few of the SharePoint column types like Multiple lines of text, Hyperlink or Picture, Image, etc. does not support sorting or filtering from SharePoint modern experience list views. So, you have to use the classic experience list settings page to find the internal name for such SharePoint columns.

Follow below steps to find the internal name of multiple lines of text column using SharePoint classic experience list settings page:

1. Go to the SharePoint online list for which you want to check the internal name of a column.

2. Click on Settings (gear) icon from the top right corner and select List settings:

Open SharePoint online List settings page from modern experience list view to find the internal name of SharePoint column
Open SharePoint online list settings page

3. From list settings page, scroll down to the Columns section and click on the column name for which you want to find the internal name:

Open SharePoint online column settings page from classic experience list settings page to find the internal name of SharePoint column
Open SharePoint online Column settings page

4. SharePoint will open column settings page for the respective column with browser URL like:

https://contoso.sharepoint.com/sites/wlive/_layouts/15/FldEdit.aspx?List=%7B6FBA7FAE-AFC0-45D6-99EE-0AB20629EE41%7D&Field=MultilineTextCol
SharePoint online column settings page showing internal name of column
SharePoint online column settings page showing internal name of column

Where column name (MultilineTextCol) after Field= is the internal name of your SharePoint online multiple lines of text column.

Note: You can use this classic experience method to find out the internal name of SharePoint columns for all column types.

Using SharePoint REST API

You can use SharePoint REST API endpoint like below to get the internal name of SharePoint column based on it’s display name. Open URL in below format directly from browser tab:

https://contoso.sharepoint.com/sites/SPConnect/_api/web/lists/getbytitle('InternalNames')/fields?$select=Title,InternalName&$filter=Title eq 'Multiline Text Column'
Find internal name of SharePoint online list column using SharePoint REST API
Find internal name of SharePoint column using SharePoint REST API
Using PnP PowerShell

You can use below PnP PowerShell script to find the internal name of SharePoint online list column using PnP PowerShell:

# SharePoint online site URL
$siteUrl = "https://contoso.sharepoint.com/sites/wlive"

# Display name of SharePoint list
$listName = "InternalNames"

# Display name of SharePoint list column
$columnName = "Multiline Text Column"
 
# Connect to SharePoint online site
Connect-PnPOnline -Url $siteUrl -Interactive
 
# Get internal name of SharePoint list column
Get-PnPField -Identity $columnName -List $listName | Select Title,InternalName
Find internal name of SharePoint online list column using PnP PowerShell
Find internal name of SharePoint column using PnP PowerShell
Using CLI for Microsoft 365

You can use below CLI for Microsoft 365 script to find the internal name of SharePoint online list column using CLI for Microsoft 365:

# SharePoint online site URL
$siteUrl = "https://contoso.sharepoint.com/sites/wlive"

# Display name of SharePoint list
$listName = "InternalNames"

# Display name of SharePoint list column
$columnName = "Multiline Text Column"
 
# Get Credentials to connect
$m365Status = m365 status
if ($m365Status -match "Logged Out") {
	m365 login
}

# Get internal name of SharePoint list column
m365 spo field get --webUrl $siteUrl --listTitle $listName --title $columnName --output text
Find internal name of SharePoint online list column using CLI for Microsoft 365
Find internal name of SharePoint column using CLI for Microsoft 365

Best practices for naming SharePoint columns

When creating columns in SharePoint, it’s important to follow best practices for column naming to avoid using special characters or Unicode characters in internal names. Here are some recommended best practices:

  1. Use only alphanumeric characters: Stick to using letters (A-Z, a-z) and numbers (0-9) in column names. Avoid using special characters such as @, #, $, %, _, etc. Avoid column names beginning with numbers.
  2. Avoid spaces: Use PascalCase to separate words in column names instead of spaces. For example, use ColumnName instead of Column Name. This can help prevent issues with URLs, Unicode encoding, and referencing column names in scripts or code.
  3. Avoid reserved words: SharePoint has reserved words that are used for system functionality, and using them in column names may cause conflicts. Examples of reserved words include “ID”, “Modified”, “Created”, “Title”, etc. Avoid using these reserved words as column names.
  4. Keep it concise and meaningful: Use descriptive and meaningful names for columns that clearly indicate their purpose. Avoid using vague or generic names that may be confusing or ambiguous to users. Use column description to provide more information about the columns.
  5. Be consistent: Establish a consistent naming convention for columns across your SharePoint site or site collection to ensure uniformity and ease of management. This can also help with documentation, training, and maintenance of your SharePoint environment.

I hope you liked this article. Give your valuable feedback & suggestions in the comments section below and share this article with others.

Learn more

✇Ganesh Sanap Blogs

Introduction to SharePoint Spaces

In this blog we will explore the SharePoint spaces, it’s history & roadmap and how to enable SharePoint spaces in a SharePoint online site.

What’s SharePoint Spaces

As per the Microsoft documentation, SharePoint spaces is defined as:

“SharePoint spaces is a web-based, immersive platform, which lets you create and share, secure and extensible mixed reality experiences. Add a new dimension to your intranet by using 2D and 3D web parts to create your mixed reality vision.”

SharePoint Spaces allows users to easily build mixed reality experiences that interact with content stored in SharePoint Online.

SharePoint spaces empower creators to build immersive mix reality experiences with point-and-click simplicity. You can get started with smart templates to create a mixed reality environment complete with beautiful surroundings, ambient sounds, rich textures, and lighting. You then add content, which can include files you already have in SharePoint, allowing you to repurpose your existing data, documents, and images.

History & Roadmap

  • Microsoft announced SharePoint Spaces first time during its annual SharePoint Virtual Summit held in May 2018.
  • Microsoft announced SharePoint spaces public preview in April 2020, Roadmap.
  • Microsoft added 360° tour web part in SharePoint spaces which allows creation of immersive virtual tours for SharePoint sites, Roadmap.
  • Microsoft added touch device support in SharePoint spaces which enables users to interact with a space using touch interactions in addition to the mouse and keyboard-based interactions, Roadmap.
  • Microsoft announced General Availability of SharePoint spaces, Roadmap.
Organization chart in SharePoint spaces in SharePoint online site
Org Chart in a SharePoint Space

That’s it for SharePoint spaces introduction and history. Let’s see how you can enable SharePoint spaces in your SharePoint online site to get started with it.

Enable SharePoint spaces in a site

SharePoint spaces are not enabled by default in SharePoint online site. To use SharePoint spaces, we need to enable a site feature named “Spaces”.

You can activate this feature using any one of the methods given below:

Manually:

You can activate Spaces feature from user interface by navigating to Manage site features page.

Hit (URL: https://tenant.sharepoint.com/sites/siteName/_layouts/ManageFeatures.aspx) in browser tab by replacing tenant and siteName or follow below steps:

  1. Go to SharePoint site where you want to build a space
  2. Click on Settings (gear icon), select Site information and then select View all site settings.
  3. On the Site settings page, select Manage site features under Site Actions.
  4. Scroll down the page to Spaces feature and click on Activate button.
  5. Wait till the page refreshes and confirm that feature is activated successfully.
SharePoint online site features settings
Activated Spaces feature
Using PnP PowerShell:

You can easily activate features in SharePoint online using PnP PowerShell. To activate a site feature using PnP PowerShell you will need the GUID of feature. Check how you can quickly get the GUID of a site feature. GUID of Spaces feature is 2ac9c540-6db4-4155-892c-3273957f1926.

Use below command to activate Spaces feature:

Enable-PnPFeature -Identity 2ac9c540-6db4-4155-892c-3273957f1926 -Scope Web

You can find the detailed example of how to activate a site feature in SharePoint Online using PnP PowerShell here.

To get an idea about what you can do using SharePoint spaces, check out some of the awesome samples here.

See also

✇Ganesh Sanap Blogs

Activate a site feature in SharePoint Online using PnP PowerShell

In my previous blog about Introduction to SharePoint Spaces, I explained different methods to enable SharePoint spaces in a SharePoint online site. One of the method was to activate a Spaces feature using PnP PowerShell.

So, I thought of writing a separate blog on how to activate a site feature in SharePoint Online using PnP PowerShell.

In SharePoint Online, we can easily activate a feature using Enable-PnPFeature cmdlet. To activate a feature using PnP PowerShell you will need the GUID of feature. Check how you can quickly get the GUID of a site feature.

In this blog, we will activate a site level feature named Spaces whose GUID is 2ac9c540-6db4-4155-892c-3273957f1926.

$siteUrl = "https://tenant.sharepoint.com/Sites/siteName"
$featureScope = "Web"	#Scope of feature 
$featureId = "2ac9c540-6db4-4155-892c-3273957f1926"	#SharePoint Spaces Feature
 
#Connect to SharePoint site
Connect-PnPOnline -Url $siteURL -Interactive
 
#Get Feature from SharePoint site
$spacesFeature = Get-PnPFeature -Scope $featureScope -Identity $featureId
 
#Check if feature is already activated or not
if($spacesFeature.DefinitionId -eq $null) {  
    Write-host "Activating Feature ($featureId)..." 
	
    #Activate the Feature
    Enable-PnPFeature -Scope Site -Identity $FeatureId -Force
 
    Write-host -f Green "Feature ($featureId) has been activated Successfully!"
}
else {
    Write-host "Feature ($featureId) is already active on this site!"
}

Output:

SharePoint online Site Features Settings in Manage site features
Activated Spaces feature

Similarly, you can also activate the site collection level features by changing -Scope to “Site”.

I hope you liked this blog. Give your valuable feedback & suggestions in the comments section below and share this blog with others.

✇Ganesh Sanap Blogs

Inline channels post translation in Microsoft Teams iOS and Android

Inline message translation is a Microsoft Teams feature that allow users to translate Teams messages into the language specified by their personal language settings. This nice feature is already available in Microsoft Teams Desktop client and web.

Now, Microsoft is releasing the inline message translation feature for Microsoft Teams iOS and Android apps which will allow users to translate channel posts that are in another language, into the language of their choice. Microsoft will make this feature available to iOS and Android users with the latest app store updates starting from early June to mid-July.

How this works?

After updating the Microsoft Teams app from app store, end users will be able to translate channel posts into their preferred language while working on their Android and iOS devices.

To translate the channel post or reply, user has to press and hold the message and then select Translate. The post/reply will be translated to the language specified by their personal language settings. To return a translated message to the original language, press and hold the translated message and then select See original (language).

Inline message translation in Microsoft Teams iOS and Android apps
Inline message translation in Microsoft Teams iOS and Android

How to set the translation language?

To set the preferred language that you want messages translated to, go to Settings –> select Translation and then choose the desired language under Translate messages into this language.

Set inline message translation language in Microsoft Teams iOS or Android

How to Turn on/off inline message translation in Microsoft Teams?

The ability to translate messages will be on by default in Microsoft Teams. If you want to turn off the inline message translation in Microsoft Teams or if you have turned it off previously & now you want to turn it on, follow below steps:

  1. Go to Microsoft Teams admin center
  2. Select Messaging Policies from the left navigation
  3. Either create a new policy or edit an existing policy
  4. Set the Translate messages option to On/Off

You can also turn on/off inline message translation in Microsoft Teams using PowerShell command Set-CsTeamsMessagingPolicy. You need to set the -AllowUserTranslation parameter to true to allow users to translate messages & false to prohibit users from translating messages in Microsoft Teams.

Example
Set-CsTeamsMessagingPolicy -Identity MyMessageTranslationPolicy -AllowUserTranslation $false
Note

The Microsoft Teams policy takes few minutes to apply. Sometimes users might need to sign out and sign back in to Microsoft Teams.

✇Ganesh Sanap Blogs

Hide/Disable Web search external images in SharePoint Online

SharePoint Online offers powerful web parts and features that enhance the visual appeal of your sites, including the ability to search for external images on the web while using web parts like Image, Hero, Image Gallery, Quick links, etc. While this feature can be valuable in various contexts, there are scenarios where organizations prefer to disable or hide the option to search for external images especially when they have created organization assets libraries in the SharePoint tenant.

In this blog post, we’ll explore how to hide/disable the “Web search” feature in SharePoint using SharePoint Online PowerShell, PnP PowerShell and CLI for Microsoft 365.

Using SharePoint Online PowerShell

Use below SharePoint Online PowerShell script to disable or enable external image “Web Search” feature in SharePoint Online tenant:

# SharePoint online admin center URL
$adminCenterUrl = Read-Host -Prompt "Enter your SharePoint admin center site URL (e.g https://contoso-admin.sharepoint.com/)"

# Connect to SharePoint online admin center
Connect-SPOService -Url $adminCenterUrl

# Disable external image "Web Search" feature in SharePoint
Set-SPOTenant -FilePickerExternalImageSearchEnabled $false

# Enable external image "Web Search" feature in SharePoint
# Set-SPOTenant -FilePickerExternalImageSearchEnabled $true

# Disconnect SharePoint online connection
Disconnect-SPOService

Using PnP PowerShell

You can use below PnP PowerShell script to hide/disable external image “Web Search” feature in SharePoint Online:

# SharePoint online admin center URL
$adminCenterUrl = Read-Host -Prompt "Enter your SharePoint admin center site URL (e.g https://contoso-admin.sharepoint.com/)"

# Connect to SharePoint online admin center
Connect-PnPOnline -Url $adminCenterUrl -Interactive

# Disable external image "Web Search" feature in SharePoint
Set-PnPTenant -FilePickerExternalImageSearchEnabled $false

# Enable external image "Web Search" feature in SharePoint
# Set-PnPTenant -FilePickerExternalImageSearchEnabled $true

# Disconnect SharePoint online connection
Disconnect-PnPOnline

Using CLI for Microsoft 365

Use below CLI for Microsoft 365 script to remove/disable external image “Web Search” feature in SharePoint Online tenant:

# Get Credentials to connect
$m365Status = m365 status
if ($m365Status -match "Logged Out") {
m365 login
}

# Disable external image "Web Search" feature in SharePoint
m365 spo tenant settings set --FilePickerExternalImageSearchEnabled false

# Enable external image "Web Search" feature in SharePoint
# m365 spo tenant settings set --FilePickerExternalImageSearchEnabled true

# Disconnect SharePoint online connection
m365 logout

Conclusion

Disabling or hiding the web search for external images in SharePoint Online is a strategic choice for organizations that prioritize content security, brand consistency and compliance. By following the methods outlined in this blog post, you can tailor your SharePoint environment to align with your organization’s policies and enhance the overall governance of your digital assets.

Learn more

✇Ganesh Sanap Blogs

Remove an Organization Assets Library from SharePoint Online using PowerShell

In my previous blog post – Create an Organization Assets Library in SharePoint Online, I explained what is an Organization Assets Library in SharePoint, different types of organization assets libraries and provided a step-by-step guide on how to create organization assets libraries in SharePoint Online using SharePoint Online PowerShell, PnP PowerShell and CLI for Microsoft 365.

In this blog post, we will explore how to remove or unregister a SharePoint online document library from organization assets libraries using PnP PowerShell and CLI for Microsoft 365.

Using PnP PowerShell

You can use below PnP PowerShell script to remove a SharePoint document library that was designated as a central location for organization assets across the tenant:

# URL of SharePoint online document library
$libraryUrl = "https://contoso.sharepoint.com/sites/OrgAssets/CompanyLogos"

# SharePoint online admin center URL
$adminCenterUrl = Read-Host -Prompt "Enter your SharePoint admin center site URL (e.g https://contoso-admin.sharepoint.com/)"

# Connect to SharePoint online admin center
Connect-PnPOnline -Url $adminCenterUrl -Interactive

# Remove organization assets library from SharePoint Online
Remove-PnPOrgAssetsLibrary -LibraryUrl $libraryUrl

# Disconnect SharePoint online connection
Disconnect-PnPOnline

Using CLI for Microsoft 365

Use below CLI for Microsoft 365 script to unregister the given SharePoint Online document library as an organizational asset source in the tenant:

# URL of SharePoint online document library
$libraryUrl = "https://contoso.sharepoint.com/sites/OrgAssets/CompanyLogos"

# Get Credentials to connect
$m365Status = m365 status
if ($m365Status -match "Logged Out") {
m365 login
}

# Unregister a SharePoint document library from organization assets libraries
m365 spo orgassetslibrary remove --libraryUrl $libraryUrl --force

# Disconnect SharePoint online connection
m365 logout

Note: It might take up to 24 hours to remove an organization assets library from “Your organization” tab in the file/image picker after you unregister it from the SharePoint tenant organization asset libraries.

Learn more

✇Ganesh Sanap Blogs

Register SharePoint Document Library as an Organization Assets Library using PowerShell

In my previous blog post – Create an Organization Assets Library in SharePoint Online, I explained what is an Organization Assets Library in SharePoint, different types of organization assets libraries and provided a step-by-step guide on how to create organization assets libraries in SharePoint Online using SharePoint Online PowerShell.

In this blog post, we will explore how to register a SharePoint online document library as an organization assets library using PnP PowerShell and CLI for Microsoft 365. Before using below PowerShell scrips, follow this blog post until step #3 to create a SharePoint online communication site, granting proper permissions on the site and creating document libraries as per your requirements.

Using PnP PowerShell

You can use below PnP PowerShell script to register a SharePoint online document library as an organization assets library:

# URL of SharePoint online document library
$libraryUrl = "https://contoso.sharepoint.com/sites/OrgAssets/CompanyLogos"

# Type of Organization assets library - ImageDocumentLibrary or OfficeTemplateLibrary
$orgAssetType = "ImageDocumentLibrary"

# SharePoint online admin center URL
$adminCenterUrl = Read-Host -Prompt "Enter your SharePoint admin center site URL (e.g https://contoso-admin.sharepoint.com/)"

# Connect to SharePoint online admin center
Connect-PnPOnline -Url $adminCenterUrl -Interactive

# Register a document library as an organization assets library
Add-PnPOrgAssetsLibrary -LibraryUrl $libraryUrl -OrgAssetType $orgAssetType

# Disconnect SharePoint online connection
Disconnect-PnPOnline

Using CLI for Microsoft 365

Use below CLI for Microsoft 365 script to register a SharePoint document library as an organization assets library for images:

# URL of SharePoint online document library
$libraryUrl = "https://contoso.sharepoint.com/sites/OrgAssets/CompanyLogos"

# Type of Organization asset library - ImageDocumentLibrary or OfficeTemplateLibrary
$orgAssetType = "ImageDocumentLibrary"

# Get Credentials to connect
$m365Status = m365 status
if ($m365Status -match "Logged Out") {
m365 login
}

# Register a SharePoint document library as an organization asset library
m365 spo orgassetslibrary add --libraryUrl $libraryUrl --orgAssetType $orgAssetType

# Disconnect SharePoint online connection
m365 logout

Note: You need SharePoint tenant administrator permissions to run above PowerShell scripts.

Learn more

✇Ganesh Sanap Blogs

Create an Organization Assets Library in SharePoint Online

In the dynamic world of business collaboration, organizing and sharing digital assets efficiently is a key factor for success. SharePoint Online provides a robust solution for managing organizational assets through the creation of an “Organization Assets Library.” In this blog post, we’ll explore what an Organization Assets Library is and provide a step-by-step guide on how to create organization asset libraries in SharePoint Online.

What is an Organization Assets Library in SharePoint?

An organization assets library in SharePoint is a centralized repository for storing and managing digital assets like images such as company branding photos & logos and office templates like word, excel & PowerPoint documents that are commonly used across the organization. It provides a structured way to organize, access, and share these assets, ensuring consistency in branding (logos, style guides, templates) and seamless collaboration.

Types of Organization Assets Library

You can create two types of Organization Assets libraries in SharePoint Online:

  • Organization Asset Library for Images (ImageDocumentLibrary): Document library for images like branding images, company logos, etc. These images will be available under “Your organization” option when user opens the file picker while adding images in SharePoint web parts and pages.
  • Organization Asset Library for Office Templates (OfficeTemplateLibrary): Document library for office templates like word, excel and PowerPoint. These templates will be available when user creates a new office document from Office Apps. Follow this article for creating office templates.

How to Create an Organization Assets Library in SharePoint Online?

Step 1: Create a SharePoint Online site

You can use an existing site or create a new site for storing organization assets. The site can be of any type (communication site or team site). However, I will recommend you to create a new/blank communication site for hosting organization asset libraries. Follow this guide for creating a new SharePoint site: Create a site in SharePoint.

Step 2: Grant permissions on SharePoint Online site

Grant following permissions on the newly created SharePoint communication site:

  1. Owners: Add users who should be able to upload files to asset libraries as well as manage permissions of the site.
  2. Members: Add users who should be able to upload files to asset libraries.
  3. Visitors: Add Everyone except external users group so that all users in tenant can see assets.
Step 3: Create Document libraries and upload assets

Create new document libraries to store the organization assets by following this guide: Create a document library in SharePoint. After creating document libraries, upload the images or office templates to your document libraries.

Step 4: Register Document library as organization asset library

First of all, download the latest version of SharePoint Online Management Shell. Then you can run SharePoint Online PowerShell script like below from SharePoint Online Management Shell to register a document library as an organization asset library for images (you can use $orgAssetType = "OfficeTemplateLibrary" for office templates asset library):

# URL of SharePoint document library
$libraryUrl = "https://contoso.sharepoint.com/sites/OrgAssets/Images"

# Type of Organization asset library - ImageDocumentLibrary or OfficeTemplateLibrary
$orgAssetType = "ImageDocumentLibrary"

# SharePoint online admin center URL
$adminCenterUrl = Read-Host -Prompt "Enter your SharePoint admin center site URL (e.g https://contoso-admin.sharepoint.com/)"

# Connect to SharePoint online admin center
Connect-SPOService -Url $adminCenterUrl

# Register document library as an organization asset library
Add-SPOOrgAssetsLibrary -LibraryURL $libraryUrl -OrgAssetType $orgAssetType

# Disconnect SharePoint online connection
Disconnect-SPOService

You’ll be prompted to enable a content delivery network (CDN) while adding an organization asset library, type Y (Yes) or A (Yes to All) and press Enter.

If you get an error – Add-SPOOrgAssetsLibrary : This library is not on the site that contains other organization asset libraries while running above PowerShell script, that means some other organization asset libraries are already available in your Microsoft 365 SharePoint tenant. In that case, try this:

1. Firstly, check if you have any existing organization asset libraries in your Microsoft 365 tenant using this command:

Get-SPOOrgAssetsLibrary

2. Create a new document library on same SharePoint site where your existing organization asset libraries are created.

3. Run PowerShell script given in step 4 to register the newly created document library as an organization asset library.

Notes

  1. You can create up to 30 organization asset libraries for a single tenant / organization.
  2. All organization asset libraries must be on the same SharePoint site.
  3. Only document libraries (not folders) can be set as organization asset libraries.
  4. It may take up to 24 hours for the organization assets library to appear in the desktop office apps.
  5. Users need at least read permissions on the SharePoint root site for the organization assets library to appear in the desktop office apps.

How to Remove an Organization Assets Library from SharePoint Online?

If you want to remove/unregister an existing organization asset library from your SharePoint tenant, you can use below SharePoint Online PowerShell script:

# URL of SharePoint document library
$libraryUrl = "https://contoso.sharepoint.com/sites/OrgAssets/Images"

# SharePoint online admin center URL
$adminCenterUrl = Read-Host -Prompt "Enter your SharePoint admin center site URL (e.g https://contoso-admin.sharepoint.com/)"

# Connect to SharePoint online admin center
Connect-SPOService -Url $adminCenterUrl

# Remove/unregister an organization asset library in SharePoint tenant
Remove-SPOOrgAssetsLibrary -LibraryUrl $libraryUrl

# Disconnect SharePoint online connection
Disconnect-SPOService

In conclusion, implementing an organization assets library in SharePoint Online can significantly enhance the management and utilization of essential resources within your organization. By centralizing assets, maintaining consistency, and enabling seamless collaboration, SharePoint empowers teams to work more efficiently and effectively.

Learn more

✇Ganesh Sanap Blogs

Disable Quick property editing (Grid view) from SharePoint Online list

SharePoint Online and Microsoft Lists offers a multitude of features to enhance collaboration and streamline data management. One such feature is the Quick Property Editing (Edit in Grid view), which allows users to bulk edit metadata for multiple list items directly from the list view. While this feature can improve efficiency, there are scenarios where disabling it becomes necessary. In this blog post, we’ll explore various methods to achieve this in SharePoint Online.

From SharePoint UI

Follow below steps to disable quick edit (Edit in grid view) from SharePoint list UI:

1. Go to your SharePoint Online list.

2. Click on Settings (gear icon) from the top right corner and select List settings.

3. Click on Advanced settings link from List settings page.

4. From Advanced settings page, scroll down and set Quick property editing (Allow items in this list to be edited using Quick Edit and the Details Pane?) to No.

5. Click OK button at the bottom of advanced list settings page.

Using PnP PowerShell

You can use below PnP PowerShell script to disable Quick property editing (Grid view) from SharePoint Online list or document library:

# Display name of SharePoint online list or document library
$listName = "My SharePoint List"

# SharePoint online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint site URL (e.g https://contoso.sharepoint.com/sites/pnppowershell)"

# Connect to SharePoint online site
Connect-PnPOnline -Url $siteUrl -Interactive

# Disable Quick property editing (Grid view) from SharePoint list
Set-PnPList -Identity $listName -DisableGridEditing $true

Write-Host "Done! :-)" -ForegroundColor Green

# Disconnect SharePoint online connection
Disconnect-PnPOnline

You can set -DisableGridEditing to $false to enable the quick edit (edit in grid view) back to your SharePoint list.

Using CLI for Microsoft 365

Use below CLI for Microsoft 365 script to disable Quick property editing (Edit in grid view) from SharePoint Online or Microsoft Lists:

# Display name of SharePoint online list or document library
$listName = "My SharePoint List"

# SharePoint online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint site URL (e.g https://contoso.sharepoint.com/sites/cliformicrosoft365)"

# Get Credentials to connect
$m365Status = m365 status
if ($m365Status -match "Logged Out") {
m365 login
}

# Disable Quick property editing (Grid view) from SharePoint list
m365 spo list set --webUrl $siteUrl --title $listName --disableGridEditing true

Write-Host "Done! :-)" -ForegroundColor Green

# Disconnect SharePoint online connection
m365 logout

You can set --disableGridEditing to false to enable the quick property editing (edit in grid view) for your SharePoint online list.

Learn more

✇Ganesh Sanap Blogs

SharePoint Online: All you need to know about Commenting in Lists

Microsoft recently introduced a new feature of commenting in SharePoint Online lists and Microsoft lists. Using this feature users will be able to add and delete comments on list items. Users can view all comments on a list item and filter between views that show comments or activity related to an item in details pane.

Microsoft has started rolling out this feature to all SharePoint Online tenants in December 2020 release, see Roadmap.

Where can you find Comments options?

Comments options are currently located at below three places in SharePoint Online/Microsoft lists:

List view

Users can see which list items have comments when they access the SharePoint Online list view or Microsoft list home page. Comments option will be shown on command bar when you select a list item as well as at the right hand side of Title column. When you hover over on comments icon it will show you the count of comments added to the list item.

New Comments in SharePoint list view
Comments options in List view
Display/Edit form

By default, users will see a new comments pane alongside the list item form when they access a list. Users can toggle the comment pane visibility by clicking the comments icon. When you hide comments, the pane does not collapse. The comments pane will be closed by default for lists customized by Power Apps.

New Comments in SharePoint list display form
Comments options on Display form
Details Pane

Users can see the Comments and All activity related to list item on details pane. Users can filter views that show comments or activity by using the dropdown under “More details” section.

New Comments options in Details pane in SharePoint Online list
Comments options in Details pane

Permission Considerations

Comments follow the permission settings inherent in SharePoint Online and Microsoft Lists.

  • Users with read-only permission can only view comments.
  • Those with list edit permission can make comments as well as delete comments; editing comments is currently not possible. 

Where the Comments will be stored?

Comments are stored in the schema for each list, which is based on the SharePoint storage platform.

Working with SharePoint REST APIs

As comments are stored within the list schema itself and not with list items, it is not possible to fetch comments using  $select with /items endpoint. However, you can get the list item comments using below endpoint:

https://<tenant>.sharepoint.com/sites/<site>/_api/web/lists/getbytitle('<list-name>')/GetItemById(<item-id>)/Comments()

//OR

https://<tenant>.sharepoint.com/sites/<site>/_api/web/lists/getbytitle('<list-name>')/items(<item-id>)/Comments()

For more information on working with comments using SharePoint REST APIs, check:

Working with JSON Formatting

Currently it is not possible to get the actual list item comments value using JSON formatting. But, you can get the count of comments added to list item using [$_CommentCount] which is an internal name of SharePoint list column that returns the count of list item comments.

Check how you can get comments count and show it in SharePoint list view at: Working with SharePoint Online/Microsoft List Comments using JSON Formatting.

Current Limitations

  • Editing comments is currently not possible.
  • Any user can delete the list item comments. Currently there is no way to disable deletion of comments.
  • Maximum characters limit in list comments: 2000 characters
  • Classic lists that are not yet built to show up in modern user interfaces, like Task lists, will not have this commenting feature.
  • Commenting on lists in Teams is not available with this release.
  • Comments are not indexed by Search.

Enable/Disable Comments

Currently it is not possible to disable commenting at the site or list level. Microsoft is working on the new feature which will allow users to enable/disable the comments for individual SharePoint lists. However, Admins can enable/disable this feature at the organization level by changing the CommentsOnListItemsDisabled parameter in the Set-SPOTenant PowerShell cmdlet:

Read more about how to enable/disable the commenting in SharePoint Online/Microsoft Lists at: How to Enable/Disable the commenting in SharePoint Online/Microsoft Lists.

What’s Next?

  • Currently it is not possible to disable commenting at the site or list level. Microsoft is currently working on this feature update, more information at: Enable/Disable the comments for a SharePoint Online/Microsoft List.
  • @mentions in comments:
    • Get a colleague’s attention to an item in a list by @mentioning them within list comments. That person will receive a notification and a link that takes them directly back to the item, to review the comment and take the requested action.

I hope you liked this blog. Give your valuable feedback & suggestions in the comments section below and share this blog with others.

✇Ganesh Sanap Blogs

Create Colored Folders in SharePoint Online using CLI for Microsoft 365

In my previous blog post Creating Colored Folders in SharePoint Online and OneDrive, we saw how to create colored folders in SharePoint online document libraries and OneDrive for Business using user interface (UI) from browser. In this blog post, we’ll explore how to create colorful folders in SharePoint Online using CLI for Microsoft 365, a powerful command-line tool that extends SharePoint’s capabilities.

This new feature of coloring SharePoint & OneDrive folders allows users to assign a color label to folders, providing a visual cue for organization and categorization. However, it’s essential to understand how this works internally and what values are used for coloring folders in SharePoint Online and OneDrive for Business.

Thanks to Tetsuya Kawahara and his PnP PowerShell script sample at Create Colored Folder which explains SharePoint uses the column with internal name as _ColorHex to store the color setting information of folders. The _ColorHex field is a hidden field within SharePoint libraries, and it is not visible by default in standard views. This field stores the color as a numeric value corresponding to each color.

SharePoint supports a predefined set of 16 numerical color values that can be used to color folders. The following table shows the numerical values corresponding to each color:

Color_ColorHex value
YellowEmpty or 0
Dark red1
Dark orange2
Dark green3
Dark teal4
Dark blue5
Dark purple6
Dark pink7
Grey8
Light red9
Light orange10
Light green11
Light teal12
Light blue13
Light purple14
Light pink15

We will see how to use these _ColorHex column values to create a new folder in SharePoint online document library using CLI for Microsoft 365 below:

Step 1: Install the CLI for Microsoft 365

Before we can start working with the CLI for Microsoft 365, we need to install it. You can install the CLI for Microsoft 365 by using below NPM commands or by following the instructions on the official documentation page:  CLI for Microsoft 365 – Installation.

npm install -g @pnp/cli-microsoft365

You have to use below command if you want to install beta version of CLI for Microsoft 365:

npm install -g @pnp/cli-microsoft365@next

Step 2: Create colored folder using CLI for Microsoft 365

After installation of CLI for Microsoft 365,  you can use below CLI for Microsoft 365 script to create a new colored folder in SharePoint online document library using CLI for Microsoft 365:

# Set Variables
$siteUrl = "https://contoso.sharepoint.com/sites/work"
$relativeUrlOfParentFolder = "/ColoredFolders"
$documentLibraryDisplayName = "Colored Folders"
$folderName = "Confidential"
$folderColor = 1

try {
    # Get Credentials to connect to SharePoint Online site
    $m365Status = m365 status
    if ($m365Status -match "Logged Out") {
        m365 login
    }

    # Create the folder
    $newFolder = m365 spo folder add --webUrl $siteUrl --parentFolderUrl $relativeUrlOfParentFolder --name $folderName | ConvertFrom-Json

    # Get the created folder item
    $newFolderItem = m365 spo listitem get --webUrl $siteUrl --listTitle $documentLibraryDisplayName --uniqueId $newFolder.UniqueId | ConvertFrom-Json

    # Change the value of the _ColorHex column of the created folder to change the color
    m365 spo listitem set --webUrl $siteUrl --listTitle $documentLibraryDisplayName --id $newFolderItem.Id --_ColorHex $folderColor

    Write-Host "Folder created and color changed successfully." -ForegroundColor Green
    Write-Host "Folder URL: $siteUrl/$relativeUrlOfParentFolder/$folderName" -ForegroundColor Green
}
catch {
    Write-Host "An error occurred: $_" -ForegroundColor Red
}
finally {
    # Disconnect from SharePoint site
    m365 logout
}

Once you run above script successfully and navigate to SharePoint document library, you will see that new colored folder is created inside the SharePoint document library as given below: 

Create Colored Folders in SharePoint Online using CLI for Microsoft 365
Colored folders created in SharePoint Online using CLI for Microsoft 365

Conclusion

Adding color to your folders in SharePoint Online document libraries using CLI for Microsoft 365 is a simple yet effective way to enhance the visual organization and management of your documents. This can improve user experience and help users quickly identify and access the content they need. Experiment with different colors and organizational schemes to find what works best for your team or organization.

Learn more

✇Ganesh Sanap Blogs

How to Enable or Disable Auto News Digest in SharePoint Online

In today’s fast-paced work environment, staying up to date with the latest news and updates within an organization is crucial. SharePoint Online offers a powerful feature called Auto News Digest, which automatically aggregates the latest news posts from various SharePoint sites and Organization news sites that are relevant to users and sends an automated email to users.

SharePoint uses Microsoft Graph to determine if the news post is relevant for a user or not. SharePoint sends one email digest per week. By leveraging this feature, users can stay informed without having to manually visit each site individually, saving time and ensuring they don’t miss out on important updates.

In some cases, organizations that already have a high volume of emails may choose to disable SharePoint Auto News Digest feature to minimize the number of additional emails being sent to users. You can use any one of the approaches given below for enabling or disabling auto news digest feature in SharePoint online for all users at tenant level.

Using SharePoint Online PowerShell

Use below SharePoint Online PowerShell script to enable or disable the SharePoint auto news digest feature in SharePoint online at tenant level:

# SharePoint online admin center URL
$adminCenterUrl = Read-Host -Prompt "Enter your SharePoint admin center site URL (e.g https://contoso-admin.sharepoint.com/)"

# Connect to SharePoint online admin center
Connect-SPOService -Url $adminCenterUrl

# Enable Auto News Digest in SharePoint Online
Set-SPOTenant -EnableAutoNewsDigest $true

# Disable Auto News Digest in SharePoint Online
Set-SPOTenant -EnableAutoNewsDigest $false

# Disconnect SharePoint online connection
Disconnect-SPOService

Using PnP PowerShell

You can use below PnP PowerShell script for enabling or disabling the SharePoint auto news digest feature in SharePoint online for all users at tenant level: 

# SharePoint online admin center URL
$adminCenterUrl = Read-Host -Prompt "Enter your SharePoint admin center site URL (e.g https://contoso-admin.sharepoint.com/)"

# Connect to SharePoint online admin center
Connect-PnPOnline -Url $adminCenterUrl -Interactive

# Enable Auto News Digest in SharePoint Online
Set-PnPTenant -EnableAutoNewsDigest $true

# Disable Auto News Digest in SharePoint Online
Set-PnPTenant -EnableAutoNewsDigest $false

# Disconnect SharePoint online connection
Disconnect-PnPOnline

Conclusion

SharePoint Auto News Digest is a valuable feature that helps streamline information delivery within organizations. By enabling this feature, SharePoint can automatically compile and deliver news and updates from various SharePoint sites directly to users’ inboxes. Disabling Auto News Digest is also straightforward, allowing organizations to customize their SharePoint experience based on their specific requirements. SharePoint Online PowerShell and PnP PowerShell scripts provide convenient methods to enable or disable Auto News Digest effortlessly, empowering administrators to optimize their SharePoint environment for efficient information sharing.

Learn more

✇Ganesh Sanap Blogs

Enable or Disable the Social Bar (Like, Views, Save for later) for individual SharePoint sites

In my previous blog, we saw how to enable or disable the Social Bar (Like, Views, Save for later) in SharePoint Online at tenant level using SharePoint Online PowerShell, PnP PowerShell and CLI for Microsoft 365. In this blog we will explore how to enable or disable the Social Bar for individual SharePoint online site collections.

You can use any one of the approaches given below for enabling or disabling the Social Bar (Like, No. of Comments, Views, Save for later) for individual SharePoint online sites.

Using SharePoint Online PowerShell

Use below SharePoint Online PowerShell script to enable or disable the social bar from site pages for specific SharePoint online modern experience site:

# SharePoint online admin center URL
$adminCenterUrl = Read-Host -Prompt "Enter your SharePoint online admin center URL (e.g https://contoso-admin.sharepoint.com/)"

# Connect to SharePoint online admin center
Connect-SPOService -Url $adminCenterUrl

# SharePoint online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint site URL (e.g https://contoso.sharepoint.com/sites/work)"

# Disable the social bar from SharePoint online site pages
Set-SPOSite -Identity $siteUrl -SocialBarOnSitePagesDisabled $true

# Enable the social bar on SharePoint online site pages
Set-SPOSite -Identity $siteUrl -SocialBarOnSitePagesDisabled $false

# Disconnect SharePoint online connection
Disconnect-SPOService

Using PnP PowerShell

You can use below PnP PowerShell script to show or hide the social bar from SharePoint online modern experience site pages for individual SharePoint site:

# SharePoint online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint site URL (e.g https://contoso.sharepoint.com/sites/work)"

# Connect to SharePoint online site
Connect-PnPOnline -Url $siteUrl -Interactive

# Hide the social bar from SharePoint online modern site pages
Set-PnPSite -SocialBarOnSitePagesDisabled $true

# Show the social bar on SharePoint online modern site pages
Set-PnPSite -SocialBarOnSitePagesDisabled $false

# Disconnect SharePoint online connection
Disconnect-PnPOnline

Using CLI for Microsoft 365

Use below CLI for Microsoft script to show or hide the social bar from SharePoint online modern experience site pages for individual SharePoint site:

# SharePoint online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint site URL (e.g https://contoso.sharepoint.com/sites/work)"

# Connect to SharePoint online tenant
$m365Status = m365 status
if ($m365Status -match "Logged Out") {
    m365 login
}

# Hide the social bar from SharePoint online modern site pages
m365 spo site set --url $siteUrl --socialBarOnSitePagesDisabled true

# Show the social bar on SharePoint online modern site pages
m365 spo site set --url $siteUrl --socialBarOnSitePagesDisabled false

# Disconnect SharePoint online connection
m365 logout

Conclusion

By using the PowerShell scripts given in this blog post, you can enable or disable social bar features from SharePoint online modern site pages for specific SharePoint online sites.

Learn more

✇Ganesh Sanap Blogs

Enable or Disable the Social Bar (Like, Views, Save for later) in SharePoint at tenant level

SharePoint Online provides various social features in modern experience SharePoint sites. One of the features available for SharePoint site pages is the social bar (Like, No. of Comments, Views, Save for later), which is situated at the bottom of site pages. Social bar allows users to engage with page content by liking and saving pages for later reference. Social bar also shows the number of page views and comments on modern site pages.

However, organizations may have specific requirements that necessitate enabling or disabling the social bar on SharePoint site pages. Unfortunately, there are no settings available for enabling/disabling social bar using SharePoint user interface. In this blog post, we will explore how to achieve this at SharePoint tenant level using SharePoint Online PowerShell, PnP PowerShell and CLI for Microsoft 365 scripts.

Using SharePoint Online PowerShell

Use below SharePoint Online PowerShell script to enable or disable the social bar from site pages for all SharePoint sites in the tenant:

# SharePoint online admin center URL
$adminCenterUrl = "https://contoso-admin.sharepoint.com/"

# Connect to SharePoint online admin center
Connect-SPOService -Url $adminCenterUrl

# Disable the social bar from SharePoint online site pages
Set-SPOTenant -SocialBarOnSitePagesDisabled $true

# Enable the social bar on SharePoint online site pages
Set-SPOTenant -SocialBarOnSitePagesDisabled $false

Using PnP PowerShell

You can use below PnP PowerShell script to show or hide the social bar from SharePoint online modern experience site pages:

# SharePoint online admin center URL
$adminCenterUrl = "https://contoso-admin.sharepoint.com/"

# Connect to SharePoint online admin center
Connect-PnPOnline -Url $adminCenterUrl -Interactive

# Show the social bar on SharePoint online modern site pages
Set-PnPTenant -SocialBarOnSitePagesDisabled $false

# Hide the social bar from SharePoint online modern site pages
Set-PnPTenant -SocialBarOnSitePagesDisabled $true

Using CLI for Microsoft 365

Use below CLI for Microsoft 365 script to enable or disable the Social Bar (like, No. of comments, views, Save for later) in SharePoint online at tenant level:

# Get Credentials to connect
$m365Status = m365 status
if ($m365Status -match "Logged Out") {
    m365 login
}

# Disable the social bar from SharePoint online site pages
m365 spo tenant settings set --SocialBarOnSitePagesDisabled true

# Enable the social bar on SharePoint online site pages
m365 spo tenant settings set --SocialBarOnSitePagesDisabled false

Conclusion

Enabling or disabling the social bar on site pages in SharePoint Online can be achieved using SharePoint Online PowerShell, PnP PowerShell or CLI for Microsoft 365 scripts. By following the steps outlined in this blog post, you can customize the user experience and align it with your organization’s specific requirements. Whether you want to encourage user engagement or disable social features for certain scenarios, these PowerShell scripts provide the flexibility to control the social bar’s presence on SharePoint online modern site pages.

Learn more

✇Ganesh Sanap Blogs

Enable or Disable the Return to Classic SharePoint link in SharePoint Online

SharePoint Online provides a modernized and responsive user interface that offers improved collaboration, customization, and integration capabilities. It provides a clean and intuitive design, responsive layouts, and enhanced mobile support. Modern SharePoint sites include modern lists and libraries, modern web parts, and modern pages.

On modern SharePoint list and library pages, there’s a link in the lower left of the page below quick launch (left navigation) that says Return to classic SharePoint. This link allows users who are working in the SharePoint modern experience to switch the current list or document library to classic experience. On the classic page, there’s a corresponding link that says Exit classic experience which reverts the current list or document library back to modern experience.

You may want to hide Return to classic SharePoint link from list and library pages to promote the adoption & utilization of the modern experience and have consistent modern user experience across the SharePoint site.

Luckily, as a tenant administrator you have control to show or hide these links from SharePoint online modern experience using one of the ways shown below:

Using SharePoint Online PowerShell

Use below SharePoint Online PowerShell script to enable or disable the Return to classic SharePoint and Exit classic experience links from SharePoint list and document library pages:

# SharePoint online admin center URL
$adminCenterUrl = "https://contoso-admin.sharepoint.com/"

# Connect to SharePoint online admin center
Connect-SPOService -Url $adminCenterUrl

# Enable Return to classic SharePoint and Exit classic experience links
Set-SPOTenant -DisableBackToClassic $false

# Disable Return to classic SharePoint and Exit classic experience links
Set-SPOTenant -DisableBackToClassic $true

Using PnP PowerShell

You can use below PnP PowerShell script to show or hide the “Return to classic SharePoint” and “Exit classic experience” links from SharePoint online modern experience list and document library pages:

# SharePoint online admin center URL
$adminCenterUrl = "https://contoso-admin.sharepoint.com/"

# Connect to SharePoint online admin center
Connect-PnPOnline -Url $adminCenterUrl -Interactive

# Show Return to classic SharePoint and Exit classic experience links
Set-PnPTenant -DisableBackToClassic $false

# Hide Return to classic SharePoint and Exit classic experience links
Set-PnPTenant -DisableBackToClassic $true

Conclusion

Enabling or disabling the “Return to Classic SharePoint” and “Exit classic experience” links in SharePoint Online can be accomplished using SharePoint Online PowerShell or PnP PowerShell scripts. By following the steps outlined in this blog post, you can manage the user experience and tailor it to your organization’s specific requirements. Whether you embrace the modern SharePoint experience or occasionally need access to classic features, these PowerShell scripts provide the flexibility to adapt SharePoint Online to your needs.

Learn more

✇Ganesh Sanap Blogs

Set a page template as default page template in SharePoint Online

SharePoint Online is a powerful collaboration and content management platform that allows organizations to create and manage sites for various purposes. One of the key features that enhances site design and improves user experience is the use of Page Templates. In this blog post, we will delve into what are page templates in SharePoint online and how to set a default page template for a SharePoint site.

What are Page Templates in SharePoint?

Page templates in SharePoint Online are pre-designed layouts or structures that provide a consistent and standardized format for creating site pages within a site. They serve as a starting point for designing and organizing content on SharePoint pages, ensuring a cohesive look and feel across the site.

Page templates can include a variety of elements such as placeholders for text, images, web parts, page sections, and more. By using page templates, users can quickly create new pages with a predefined structure and layout, saving time and effort while maintaining visual consistency.

Setting a Default Page Template for a SharePoint Site

When users try to create new site pages from SharePoint site home page, the default selected template in the Page Templates pane is Blank. If users don’t select a different template, the blank template will be used for their new page.

If you prefer to have another custom page template be the default selection for your SharePoint site while creating new site pages, follow one of the methods given below:

Using SharePoint User Interface

Follow below steps to set a default page template for your SharePoint online site from SharePoint UI:

1. Go to home page of your SharePoint online site.

2. Click on New from page command bar and select Page:

Open Page templates pane from SharePoint online site home page
Open Page templates pane from SharePoint online site home page

3. Click on vertical ellipses at the bottom right side of the template you want, and then select Set default selection:

Set default selection of page template for SharePoint online site
Set default selection of page template for SharePoint site

4. Click OK from Changing default selection confirmation popup.

Note: When you change the default selection in the page templates pane, it will be changed for all users in the SharePoint site.

Using PnP PowerShell

You can use below PnP PowerShell script to set a page template as default page template for SharePoint online site:

# SharePoint online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint site URL (e.g https://contoso.sharepoint.com/sites/work)"

# Connect to SharePoint online site
Connect-PnPOnline -Url $siteUrl -Interactive

# Get page template details and Unique ID
$page = Get-PnPFile -Url "/sites/work/SitePages/Templates/PlainHeaderNoComments.aspx" -AsListItem

# Set a page template as default page template for SharePoint online site
Set-PnPPropertyBagValue -Key DefaultNewPageTemplateId -Value $page["UniqueId"]

# Disconnect SharePoint online connection
Disconnect-PnPOnline

You may get error like below while executing above PnP PowerShell script if custom scripts are not enabled for your SharePoint site:

Set-PnPPropertyBagValue: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) Site might have NoScript enabled, this prevents setting some property bag values.

In that case, you have to first enable the custom scripts for your SharePoint site by following: Allow use of custom scripts in SharePoint Online using PowerShell.

Using CLI for Microsoft 365

Use below CLI for Microsoft 365 script to set a page template as default page template for SharePoint online site:

# Get Credentials to connect
$m365Status = m365 status
if ($m365Status -match "Logged Out") {
    m365 login
}

# SharePoint online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint site URL (e.g https://contoso.sharepoint.com/sites/work)"
 
# Get page template details and Unique ID
$page = m365 spo file get --webUrl $siteUrl --url '/sites/work/SitePages/Templates/PlainHeaderNoComments.aspx' | ConvertFrom-Json

# Set a page template as default page template for SharePoint online site
m365 spo propertybag set --webUrl $siteUrl --key DefaultNewPageTemplateId --value $page.UniqueId

If custom scripts are not enabled for your SharePoint site, above CLI for Microsoft 365 script will throw error like:

Error: Site has NoScript enabled, and setting property bag values is not supported

In that case, you have to first enable the custom scripts for your SharePoint online site by following: Allow use of custom scripts in SharePoint Online using PowerShell.

Conclusion

Page templates in SharePoint online provide a valuable tool for enhancing site design and improving user experience. By setting a default page template, organizations can establish a consistent and standardized format for creating web pages within their SharePoint sites. This not only saves time but also ensures a cohesive and professional look across the site. By leveraging page templates, organizations can effectively showcase their content while maintaining their branding and style guidelines.

Learn more

❌