Monday, 30 November 2015

Export User alerts/ Export User Subscribed alerts in PowerShell


Write User Subscribed Alerts to CSV

Below is the PowerShell script which will export the Users who have subscribed alerts to lists and librarys in the site.

SharePoint Out of the box the provides to view users alerts SiteSettings->Usrs alerts , select the user from dropdownlist which will show huge chunk of users , select the user and click on update button which will show documentlibrary or lists which selected user has subscribed alerts.

But above requirement will not solve our problem where we need to view the consolidated list users instead of selecting each time single user through UI,

Either we can go through custom coding or powershell , below is the powershell script


cls

asnp "*sh*"

$web=Get-SPWeb http://SharePoint2013:1555/

$alerts=$web.Alerts

foreach($alert in $alerts)

{

$alert.List.Title + " ......" $alert.User.DisplayName + "   " + 

$alert.User.DisplayName  | Out-File E:\Ms\UserAlerts.csv -Encoding 

ascii -Append -Width 100

}





No comments:

Post a Comment