1

How can I fetch all the alerts from all the Site Collections in SharePoint Online/Office 365 using PowerShell script?

0

Unfortunately, there are no PowerShell Scripts available to retreive alerts from SharePoint Online (yet).

See: Index of Windows PowerShell for SharePoint Online cmdlets

-1

Here is the sample script you can try to fetch all the alerts created in SharePoint online.

Config Variables

$SiteURL = "https://my.sharepoint.com/sites/GA"

Connect to PNP Online

Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)

Fetch all the users from SharePoint online site

$users = Get-PnPUser

foreach($user in $users) { $alerts = Get-PnPAlert -User $user #Check if user has any alerts created or not. if($alerts -ne $null) { #Display the user details and alert title Write-host -Object $user.Title, $user.email, $alerts.Title } }

Note: This can only be executed for site collection admin or owners permission. Pnp powershell you would need to install. Ref: https://github.com/SharePoint/PnP-PowerShell

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.