Skip to content

Commit 3d6ff7c

Browse files
000-741: downloadable
1 parent 50ca69b commit 3d6ff7c

File tree

6 files changed

+132
-2
lines changed

6 files changed

+132
-2
lines changed

articles/en/new.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Email bodies will include the detected keyword and an inline view of the conversation for public communities. For private community conversations, a link to the detected conversation/message will be provided. Recipients must have access to the community to view the conversation.
2+

articles/en/spo/downloadable.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
layout: page
3+
title: 'Create download link to SharePoint file'
4+
image: 'https://unsplash.com/s/photos/random'
5+
hero_image: '/img/IMG_20220521_140146.jpg'
6+
show_sidebar: false
7+
hero_height: is-small
8+
date: '2025-02-09'
9+
---
10+
11+
12+
When you create a link to a file in SharePoint using the standard method, it opens in the browser by default. To make the file downloadable instead, you can customize the link to trigger a download rather than opening the file. This can be done by adjusting the file's URL or using specific download settings in SharePoint.
13+
14+
15+
16+
Navigate to your library and select the file. Click on three dots (...) and select **Download**
17+
18+
<img src="/articles/img/downloadable.PNG" width="600" alt="screenshot showing a SharePoint library"><br/>
19+
20+
In your browser click on the download icon open the **Download History**
21+
22+
23+
<img src="/articles/img/downloadable2.PNG" width="600" alt="screenshot showing a SharePoint library"><br/>
24+
25+
26+
Copy the link from your download history:
27+
28+
<img src="/articles/img/downloadable3.PNG" width="600" alt="screenshot showing downloads history"><br/>
29+
30+
31+
32+
33+
34+
### Short video
35+
36+
<video src="/articles/vid/createdownloadablefile.mp4" controls></video>
Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,100 @@
11
---
22
layout: page
3-
title: 'Enable attachments'
3+
title: 'Disable attachments in SharePoint list'
44
hero_image: '/img/IMG_20220521_140146.jpg'
55
show_sidebar: false
66
hero_height: is-small
77
date: '2025-02-09'
8-
---
8+
---
9+
10+
11+
# Disable attachments in your SharePoint lists
12+
13+
Modern SharePoint lists often allow users to attach files to list items. However, in certain scenarios, you might want to disable this feature to maintain a cleaner or more secure list environment. For example, if your list is used purely for tracking text-based data, attachments might be unnecessary or even counterproductive.
14+
15+
## User Interface
16+
17+
You can disable the attachments in your SharePoint list directly in the browser and for a single list I would recommend this approach
18+
19+
[![IMAGE ALT TEXT](http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg)](https://youtu.be/i8In3duIdq0 "Video Title")
20+
21+
22+
test
23+
24+
25+
<video src="https://youtu.be/i8In3duIdq0" controls></video>
26+
27+
## Powershell
28+
29+
30+
With PowerShell and the PnP module, disabling attachments in a SharePoint list is simple. Here’s the command to achieve this:
31+
32+
```powershell
33+
34+
Set-PnPList -Identity "Demo List" -EnableAttachments $false
35+
36+
```
37+
38+
This script disables the attachment feature for the specified list, replacing "Demo List" with the name of your target list. Make sure you are connected to your SharePoint site using the Connect-PnPOnline cmdlet before running this command.
39+
40+
41+
42+
### For all lists in one site collection
43+
44+
```powershell
45+
46+
# Connect to the SharePoint site collection
47+
Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/yoursite" -UseWebLogin
48+
49+
# Get all lists in the site
50+
$lists = Get-PnPList
51+
52+
# Disable attachments for all lists
53+
foreach ($list in $lists) {
54+
Set-PnPList -Identity $list.Title -EnableAttachments $false
55+
}
56+
57+
Write-Host "Attachments have been disabled for all lists in the site collection."
58+
59+
```
60+
61+
62+
### For all site collections (the entire tenant)
63+
64+
The script below disables attachments on all lists in the entire Microsoft 365 tenant. Mind you, Teams are also SharePoint sites!
65+
66+
```powershell
67+
68+
# Connect to the SharePoint Admin Center
69+
Connect-PnPOnline -Url "https://yourtenant-admin.sharepoint.com" -UseWebLogin
70+
71+
# Get all site collections in the tenant
72+
$sites = Get-PnPTenantSite -IncludeOneDriveSites $false
73+
74+
foreach ($site in $sites) {
75+
Write-Host "Processing site: $($site.Url)"
76+
77+
# Connect to each site
78+
Connect-PnPOnline -Url $site.Url -UseWebLogin
79+
80+
# Get all lists in the site
81+
$lists = Get-PnPList
82+
83+
# Disable attachments for all lists in the site
84+
foreach ($list in $lists) {
85+
if ($list.BaseTemplate -eq 100) { # Only target custom lists
86+
Set-PnPList -Identity $list.Title -EnableAttachments $false
87+
Write-Host "Disabled attachments for list: $($list.Title)"
88+
}
89+
}
90+
}
91+
92+
Write-Host "Attachments have been disabled for all lists in all sites."
93+
94+
```
95+
96+
97+
## Github
98+
99+
For older SharePoint versions and CSOM have a look at my other scripts at [Github](https://github.com/PowershellScripts/SharePointOnline-ScriptSamples/tree/develop/Items%20Management/Attachments)
100+

articles/img/downloadable.png

48.9 KB
Loading

articles/img/downloadable2.png

53 KB
Loading

articles/img/downloadable3.png

26.8 KB
Loading

0 commit comments

Comments
 (0)