Turn off e-mail notifications for SharePoint 2013 newsfeed

I was looking for a way to turn off all e-mail notifications for SharePoint 2013 newsfeed and found a script to do it but had to calculate the final number which is 126 if you want to turn them all off.

So here it is the script and the number for it:

credit to http://sharepointannoyances.wordpress.com/2013/11/

# Run with account that has permission for
# spshelladmin
# AND
# Full control on User Profile Service
#http://blog.sharepointclick.com/2013/04/userprofileapplicationnotavailableexcep.html

add-pssnapin microsoft.sharepoint.powershell
[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.Office.Server.UserProfiles”)

$site = get-spsite -Identity http://c4968397007:3695 #central Admin, can be other sites

#Get Context
$serviceContext = Get-SPServiceContext($site)

#Instantiate User Profile Manager
$userProfileConfigManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext);

#Get All User Profiles
$profiles = $userProfileConfigManager.GetEnumerator();

#Loop through all user profiles and display account name
foreach($profile in $profiles)
{
$profile.get_Item(“AccountName”);
$profile[“SPS-Emailoptin”].value = 126;
$profile.Commit();
}

One thought on “Turn off e-mail notifications for SharePoint 2013 newsfeed

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s