Skip to content

Commit 8288c04

Browse files
Create description.md
1 parent 1bbb621 commit 8288c04

File tree

1 file changed

+31
-0
lines changed
  • Tenant Settings/Notify OneDrive for Business owner if their content is reshared

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Short Powershell script that enables or disables a setting to send emails to OneDrive for Business owners when someone further shares the ODB owner's content with external users.
2+
3+
It uses CSOM and requires SharePoint Online SDK. The script is part of and more explained in a Technet Wiki article:
4+
5+
OneDrive for Business notification settings with Powershell
6+
7+
8+
9+
10+
11+
### How to use?
12+
Download and open the .ps1 file.
13+
Add correct libraries:
14+
15+
16+
```PowerShell
17+
#Paths to SDK
18+
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
19+
Add-Type -Path "C:\Program Files\SharePoint Client Components\16.0\Assemblies\Microsoft.Online.SharePoint.Client.Tenant.dll"
20+
``` Enter the correct url and admin login:
21+
22+
23+
```PowerShell
24+
#Enter the data
25+
$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
26+
$username="admin@TENANT.onmicrosoft.com"
27+
$Url="https://TENANT-admin.sharepoint.com"
28+
$NotifyOwnersWhenItemsReshare=$true #Whether ODB owner should be notified the content is reshared with external users
29+
```
30+
31+
Run the script

0 commit comments

Comments
 (0)