Would like to work with the "ActivityManager" object however it is throwing an error:
$site = New-Object Microsoft.SharePoint.SPSite($siteurl)
$context = [Microsoft.Office.Server.ServerContext]::GetContext($site)
$upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
$profile = $upm.GetUserProfile([string]$loginname)
$am = New-Object Microsoft.Office.Server.ActivityFeed.ActivityManager($profile, $context)
Error:
New-Object : Cannot find an overload for "ActivityManager" and the argument count: "2".
any help?
Ok,it helps
$siteurl = "http://siteurl/";
$loginname = "domain/user";
$site = New-Object Microsoft.SharePoint.SPSite($siteurl);
$context = [Microsoft.Office.Server.ServerContext]::GetContext($site);
$ServerContext = Get-SPServiceContext $site;
$upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context);
$profile = $upm.GetUserProfile([string]$loginname);
$am = New-Object Microsoft.Office.Server.ActivityFeed.ActivityManager($profile, $ServerContext);
any help how can I deselect the "Manager change" newsfeed settings?