Remove Following people from mysite for all users

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
$web = Get-SPWeb https://www.contoso.com/teams/yourteam
$context = [Microsoft.SharePoint.SPServiceContext]::GetContext([Microsoft.SharePoint.SPSite]$web.Site)
$upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager $context
$users = $web.AssociatedMemberGroup.Users | where IsDomainGroup -eq $false
$useraccounts = $users | select loginname | Foreach {"$($_.loginname)"}
foreach ($user in $users) {
$profile = $upm.GetUserProfile($user.UserLogin)
#$objectToFollowRelativeToWeb = "/"
if ($profile)
#Create a Social Manager profile
#SPSocialFollowingManager
$followManager = New-Object Microsoft.Office.Server.Social.SPSocialFollowingManager($profile, $context)
$following = $followManager.GetFollowed([Microsoft.Office.Server.Social.SPSocialActorTypes]::Users)
for ($i=$following.Count - 1; $i -ge 0; $i--) {
$followed = $following[$i]
$acctname = $followed.AccountName
#if claims:
$acctname = 'i:0#.w|'+$acctname
if ($acctname -iin $useraccounts ) {
[Microsoft.Office.Server.Social.SPSocialFollowResult]$res = $followManager.StopFollowing($followed)
Write-Verbose "$($user.UserLogin) stop following $acctname result is $res"
I have the above script from one of the technet solution to remove followeronly  for Contributors from MySite. I want this script to run for all user and remove all existing association. Can someone help me update this script.
Thanks Ba$va

Hi Basva,
According to your description, my understanding is that you want to remove all existing association for all users
The $users = $web.AssociatedMemberGroup.Users | where IsDomainGroup -eq $false is to get all users in Contributors group. You can change the line to
$users = $web.AllUsers, then run the script, compare the result.
Here is an post for getting all users using PowerShell, please take a look at:
http://www.sharepoint2013.me/Blog/Post/160/Get-all-the-unique-users-in-a-farm-using-PowerShell-script
Best Regards,
Wendy
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Wendy Li
TechNet Community Support

Similar Messages

  • How to remove cover page from hp3530 for all?

    how to remove cover page from hp3530 for all?

    Hi there Vari,
    Can you give us a little more information to help out? Is this a 3530 Deskjet printer or the 3530c scanner? Is this cover page for a fax?
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • Remove Powershell Pinned Item from taskbar for all users in 2008 R2 RDS server

    Im trying to remove the Powershell Pinned Item from the taskbar on a 2008 RDS server. I have setup a mandatory porfile from a 2008 SP2 server (because you cannot do this in R2 any more), Check the default user pinned items folder, check the registry for powershell.exe, loaded up the NTUSER.DAT file for default to see if any thing obious was there, tried some logon scripts that are suppose to remove pinned items and posted on several forums. This has to be one of the simplest dumb things i have ever worked on , and its been about a week. So how do i remove it?
    P.S.
    having the user click un pinn is not a solution
    yes i have checked C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch

    Hi Jeramy,
    The default pinned items are created the first time a user logs in. Modifying the default user profile won’t help here.
    The easiest option is to set the “Remove pinned programs from the Taskbar” to disable taskbar pinned items altogether. The default pinned items won’t show up, but the user won’t be able to pin anything else either.
    If you don't want to disable pinning altogether the solution is a little more complicated. One option is to remove the shortcuts “Accessories\Windows PowerShell\Windows PowerShell.lnk” and “Administrative Tools\Server Manager.lnk” from the common start menu folder. These shortcuts are copied to create the pinned items. If they aren’t present they can’t be pinned. This is not a supported option but it may work.
    Another option is to use IStartMenuPinnedList::RemoveFromList in a first run script to remove the pinned items. Not sure how reliable this would be due to the timing of when the default items are added compared to when the script would run.
    One other option is to use shell scripting to invoke the pin & unpin verbs on items:
    http://blogs.technet.com/deploymentguys/archive/2009/04/08/pin-items-to-the-start-menu-or-windows-7-taskbar-via-script.aspx
    This would need to be done when the user first logs in (since unpinning default items in the default user profile won't affect each new user account), but it also need to be timed after Explorer sets up the default pinned items as explained above.
    Hope one of these options work for you!
    ~Olga

  • Removal of workitems from Inbox for specific user

    Hi,
    Can anyone tell how to delete mass workitems from a specific user's inbox.
    For example if there are some 4000 workitems in a user's inbox, how can we delete all the workitems by not seleting one by one and deleting.
    Thanks&Regards,
    Pavan

    Hi,
    you can use tcode : SWWL to do that...
    This is not the right fourm for asking this ???? it should be under BPM.
    Atul

  • Just want to change the default theme to Streamline from Tradeshow for all users

    Hello, i read a lot in order to find out how to change, just default theme of portal. But seems i am doing something wrong, can you help me with step by step directions. Maybe i missed something. Thank you!

    Hi Sabina,
    Please refer: Note 1633173 - Navigation steps to change portal theme settings and http://help.sap.com/saphelp_nw73ehp1/helpdata/en/47/fdd03fc5de3c92e10000000a42189c/content.htm
    Also, check help section with your portal version.

  • How to remove the option "Set as default background..." from the right-click menu on a picture, for all users.

    Hi! I would like to know if there is any possibility to remove the option "Set as default background..." from the right-click menu on a picture, for all users. I know that's possible to edit userContent.css or userChrome.css, but this concerns only a profile at a time and being in a domain, I would like to set this for all people using Firefox.
    Can it be possible to edit a mozilla.cfg file to get the same result?
    Thank you in advance for help and tips.

    AFAIK then there is no way to do that system wide. You can only do that via userChrome.css or an extension like the Menu Editor per profile .You can install extensions globally, but the user will have to enable them anyway. That is not required for userChrome.css code.

  • Any way to remove all "apps" for all users?`

    I get that the new start menu is a compromise, and it's neat that it's "back."
    What I'm not clear on, is if it's possible to remove/hide the "apps" for all users.
    I'm not keen on having all users have all of these, especially in a corporate environment.
    Would be preferable to have none, except for perhaps what's "allowed" by admins.
    Standard office users, power users, devs, artists, accountants, most folks at work simply don't have a use for most of these apps. I also don't want bandwidth constantly being used by any of the live tiles. If a user wants to know the weather, they can go to
    weather.com. If they want news, this is also available via any number of sites.
    The other compromise of having apps "windowed" is also nice, but for an office environment, I just don't see people firing up a sandboxed calculator app (or, any of the other built-in ones).
    Sorry, but honestly, I'd honestly just like to know if it's possible to set up a GPO, or use some other method to get the "apps" out of the way of the "standard office user."

    Hi techresource0,
    Use export-startlayout cmdlet to export the start menu configuration first:
    Export-StartLayout
    http://technet.microsoft.com/en-us/library/dn283401.aspx
    Windows 10 Technical Preview has a new policy under start menu  and taskbar:
    Meanwhile, I have two thoughts on this if you are planning your environment:
    One: a customized image.
    Two: customize default profile.
    For the first thought, you can uninstall all provisioned windows store app and then deploy this image to your environment. Of course, you can do this in an online system as well.
    Removing Windows 8.1 Built-in Applications
    http://blogs.technet.com/b/deploymentguys/archive/2013/10/21/removing-windows-8-1-built-in-applications.aspx
    For second thought, you may prepare default profile, it would always copy to new created user profile:
    Customize the default local user profile when preparing an image of Windows
    http://support.microsoft.com/kb/973289
    Alex Zhao
    TechNet Community Support

  • Changes like password and removal of roles for all users

    Hi
    i want to change password for all users and remove single roles from all users.When i am doing this in SU10 changes are not reflecting for users.Please help reg this
    Vinod

    Me too...I have never been able to remove roles from multiple users with SU10.  I don't know if it's a bug or (more likely) just a confusing screen, but in 4.7 it never worked for me.

  • Permanent Regional Formatting, Save for all users, Remove Document Security

    Dear Experts,
    I have read the Documentation of Permanent Regional Formatting, Save for all users, Remove Document Security in Document Properties.
    Can anyone explain me in simple way all the above three. (More on Permanent Regional Formatting with example).
    Regards
    Sam

    There's no unmanaged Web Intelligence functionality support via .NET as far as I know.
    You might want to open a support case with SAP to get confirmation.
    Sincerely,
    Ted Ueda

  • Block all websites apart from the homepage for all users. Citrix environment with Server 2003.

    Citrix Xenapp 5 and Windows server 2003 environment. We want to force Firefox to kiosk mode with a pre-set homepage for all users. I also want to lock this to only one website. I have managed to set up the kiosk mode with R-Kiosk addon and Mozilla.cfg file. I am trying to use BlockSites to block all internet sites and only allow the one site with the whitelist option. I can get the addon to install for all users, but can’t get the default settings across. I have tried to add this with the Mozilla.cfg file, but it looks like this addon is getting it’s settings from the profile folder. If I set the preferences for the addon in Mozilla,cfg file, it actually picks it up but it doesn’t apply it to the addon for some reason. Does anyone have any other ideas on how I can lock this down to the one site?

    I am not entirely sure how to do this, but the enterprise community would be a good place to ask. They have a email group you can ask on this page: [https://www.mozilla.org/en-US/firefox/organizations/faq/]

  • How do I set the about:config settings for all users? iprism keeps prompting from authentication for users.

    When users log on and try to open Firefox 23.0.1, users are prompted with Iprism Authentication. We made changes to the firefox about:config values "network.automatic-ntlm-auth.allow.-non-fqdn" and "Network.negotiate-auth.allow-non-fqdn" to true and it works, but only works on a per user basis. How can we set this up for all users?

    I would think the about:config entries discussed are ex-factory set to values each user has to change individually, after the installation has run its course. The solution could be to have patched files ready to install post factum:
    [https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/A_brief_guide_to_Mozilla_preferences A Brief Guide to Mozilla Preferences - MDN]

  • Adding a domain user to the admin role within the local user management breaks all metro apps for all users!!

    Hi,
    I have posted this in another large thread under the "Windows 8 General" group but have not had any appropriate feedback from MS.
    After hours of testing and working with other users I have managed to isolate a simple situation that breaks all metro ui applications within Windows 8 for all users on the machine. Here are my exact steps and notes.
    Before continuing if you are running Avast then your solution may be to turn of the behaviour shield functionality as this also breaks metro apps. This is NOT the problem we are having!
    I have performed 3 cleans installs after isolating the problem and am able to reproduce the issue every time using the same steps on two different machines. 
    First thing to say is that for us it has nothing to do with simply joining the domain, domain/group policies nor does it appear to have anything to do with the software we installed, the problem here is much more simple but the result is pretty terrible.
    Here are my exact steps of what I did to reproduce our problem:
    Complete format of HDD in preperation for a clean install
    Clean install performed
    Set up the machine initially with a local account
    Test metro apps - all working fine
    Open control panel from the desktop, click on System, change the system to join the domain, click reboot
    Log into the system using my domain account
    Test metro apps - all working fine
    Here's were the problem starts. I need my domain account to have admin rights on the local machine so I can install programs without the IT men having to come over and enter their password every 5 mins.
    I go to control panel via the desktop and click on User Accounts. From with here I then click on "Manage User Accounts". This requires the IT guys to enter their details to give me access to such functionality. This is fine
    In the dialog box that opens I can only see the local user that was initially created during setup. The "Group" for this local account shows as "Administrators" - Image included below (important to note that metro apps are working at this point)
    I click add and then add my domain account - also giving it administrator access
    Sign off or reboot to ensure the new security is applied
    Sign back in to the domain account
    Test metro - ALL BROKEN
    Sign out
    Sign in as local account
    Test Metro - NOW ALL BROKEN FOR THIS USER ALSO
    So as soon as I add my domain account to the local user accounts and set it as admin it breaks all metro apps for all users. This is on a totally clean install with nothing at all installed other than the OS.
    Annoyingly if I go back and change the domain account to a standard user or if I totally remove the domain account from the local account management system the problem does not go away for either user. basically it is now permanently broken. The only fix I
    could fathom was a full re install and not giving the domain user admin access to the local  machine.
    Screen one - this is the local user accounts window AFTER joining the domain and logging in with my domain account (All metro apps working at this point)
    Screen 2: User accounts AFTER joining the domain and AFTER adding domain account to local user management (METRO BROKEN)
    I have isolated my machine from all group policies so nothing like that is affecting me. Users I have spoken to in different companies have policies that automatically add users to the local user management. This means that metro apps break as
    soon as they join the domain which leads them to wrongly think it is group policies causing the error. Once they isolate themselves from this they can reproduce following my steps.
    Thanks

    Hi Juke,
    Thank you for the response and apologies for the delay in getting back to you. My machine was running a long task so I couldn't try your suggested solution.
    I had already tried running the registry merge suggested at the top of the thread to no avail. I had not tried deleting the OLE key totally so I did that and the problem still exists. I will post all the errors I see in event viewer below. For
    your info, since posting my initial comment I have sent out my steps to 7 different people and we can all reproduce the problem. This comes to 10 different machines (3 of them mine then the other guys) in 3 different businesses / domains. We see the same errors
    in event viewer.
    Under "Windows Logs" --> "Application" : I get two separate error events the first reads "Activation of app winstore_cw5n1h2txyewy!Windows.Store failed with error: The app didn't start. See the Microsoft-Windows-TWinUI/Operational log for additional
    information." The second arrives in the log about 15 seconds after the first and reads "App winstore_cw5n1h2txyewy!Windows.Store did not launch within its allotted time."
    Under "Windows Logs" --> "System" : I get one error that reads "The server Windows.Store did not register with DCOM within the required timeout."
    Under "Applications And Services Logs" --> "Microsoft" -->  "Windows" --> "Apps" --> "Microsoft-Windows-TWinUI/Operational" : I get one error that reads "Activation of the app winstore_cw5n1h2txyewy!Windows.Store for the
    Windows.Launch contract failed with error: The app didn't start."
    If you require any further information just let me know and I will provide as much as I can.
    Thanks

  • How do I install a Thunderbird add-on for all users? Putting the XPI file into Extensions folder didn't work.

    I'm trying to install Enigmail 1.8.2 for all users. I thought I read somewhere that you don't need to unpack the XPI file.
    Whilst writing this, I did some experimenting and found a solution, but it's messy (see below). Is there an easier way?
    Fresh install of Thunderbird 31.6 on Windows 7 x64. Have observed the following:
    1. If I install the extension for one user via the Add-Ons GUI (from the marketplace, not from a local file), it does work. The Appdata\Roaming\Mozilla\Extensions folder is empty. Folder {847b3a00-7ab1-11d4-8f02-006008948af5} is created in Appdata\Roaming\Thunderbird\Profiles\xxxxxxxx.default\extensions\staged\ and moved from staged to extensions when TB is restarted.
    2. If I download the XPI file from Enigmail site and copy it to Program Files(x86)\Mozilla Thunderbird\Extensions folder, then Thunderbird's Extensions screen says "You don't have any add-ons of this type installed".
    3a. If I rename the xpi to zip (e.g. enigmail-1.8.2-tb+sm.xpi.zip) then I can open it and see that the contents are similar to what was created at point (1). If I unzip the contents, then Thunderbird doesn't recognise the add-on, unless I rename the folder to the GUID above (which could be found in install.rdf or chrome.manifest, once you know what you're looking for).
    Presumably I could also have done a per-user install, copied the folder from the profile, removed the extension, then pasted the copy into the program folder. That would save looking up the GUID but is only a little less fiddly.
    3b. After renaming the folder and restarting TB, it gives me a new tab "Install Add-on" which says "Another program on your computer would like to modify Thunderbird with the following add-on: ... Location: C:\Program Files (x86)". Once I allow the add-on, it is listed in Profiles\xxxxxxxx.default\extensions.ini.
    Aside: Disabling the add-on simply removes the line from extensions.ini, so how does TB distinguish between an unapproved add-on and a disabled one? It seems to be in extensions.json.

    Is Thunderbird already installed in the computers? If so, you could download the .xpi file and drag and drop it into the extensions window (after opening that) to install it in all the computers, following which you click the Install buttons when they become enabled, and you might have to restart Tbird afterwards.

  • Security settings for all users

    I recently developed a document that requires digital signatures and have been testing it. The only downside is that when a user opens the document, Adobe prompts for the installation of new security settings, and it installs it for that user only. I need to add a registry key to the new security settings, but it is only available to be added to the current user hive. Does anyone know how to install the new settings for all users?
    Here is the registry key I need to add.
    [HKEY_CURRENT_USER\Software\Adobe\Adobe Acrobat\9.0\Security\cPubSec]
    "bSelfSignCertGen"=dword:00000000
    Im using Adobe Reader 9.3 and Win XP.
    Any help would be terrific!
    Thanks.

    Hi,
    There are really two separate issues. First, is Adobe pushing updates to the Acrobat Address Book (i.e. adding certificates as trust anchors) and the second issue is how you can push your own update to disable the creation of self-signed digital IDs. Although the two issues share an underlying mechanism, they are separate and you cannot leverage one for the other.
    First issue first. Adobe has entered into partnership with certain Certificate Authorities and has created a mechanism to add their certificates to the Acrobat Address Book (aka Manage Trusted Identities) using http to send a copy of the Security Settings file that contains only digital IDs. There are two ways to trigger the download process. One is to go into the Preferences, select Trust Manager, and click the Update Now button in the Automatic Updates group box. The other method is to load the DigSig plug-in (beginning with Acrobat 9, plug-ins no longer load a launch in order to speed up the launch process). As I'm sure you have deduced, opening a file with a signature field cause the DigSig plug-in to load which in turn triggers the automatic download. The reason we have limited the automatic download to DigSig being loaded is because the vast majority of people viewing PDFs are not using the digital signature functionality (much to my personal chagrin because the more people use digital signatures, the better my job security ) and we didn't want to bother them with an update they would never need. People already complain that there are too many updates, and we are trying to limit the irritability factor. To close the loop on this function, once the download process has been triggered the Acrobat check two more things before it does the update, 1) has it been a month since I checked and, 2) if it has been a month is there a new file to download. This way we are not pestering people with unneeded updates, or if they do need the update, at least not too often. And finally, Address Book management has to be on a per user basis. A certificate that you may elect to trust could be a certificate that the next person want to specifically keep untrusted. The Windows Certificate Store, Mac Keychain and Firefox Certificate Manager all work on a per user basis.
    That brings us to what you would like to do. The good news is you can use the Export Security Settings featrue to create a distributable file that will set the preference. The real question is how will you distribute the file, but before we get to that, here is how to create the file.
    With Acrobat closed, set the registry setting you noted in the message above
    Launch Acrobat
    Select the Advanced > Security > Export Security Settings menu item
    Click the Deselect All button on the Export Security Settings dialog
    Select the Signing Preferences Settings checkbox
    Click the OK button on the Export Security Settings dialog
    Select Signature Creation Settings and note "Allow creation of self-signed Digital IDs" is set to No
    Click the Export button on the toolbar
    Follow the on screen dialogs. You don't have to encrypt the file, but you must sign it with a certifying signature
    At this point you have the file available for distribution. You could e-mail it to your intended recipients with import instructions, or you could post if for download, or you could set the Preference the to automatically push the file from a server. To check this feature out select the Edit > Preferences menu item and then select Security from the Categories list box. You would need to select the Load security settings from a server checkbox and then set up the URL. As an aside, you can also export these settings by selecting the Automatic Update Settings checkbox on the Export Security Settings dialog noted in the bullet points above. You have a chicken and egg problem in that you have to get the users to first manually import the file in order to set up the automatic import. That I can't help you with, you're just going to have to decide what works best for you.
    Good luck,
    Steve

  • Portal favourites for all users to be same

    hi all,
    we have implemented ESS over portal and i have added some links to portal favourites.
    they are appearing fine in my portal favourites section.
    Now the requirement is that i want all users to see the same links when they logon by their respective ids.
    but this is not happening. those links are in portal favourites for my id only.
    Kindly let me what to do.
    the way I added those links was to just click over the link in ESS workset and from the page title bar, selected the option, add to portal favourite.
    thanks

    Hi Ankur,
    I guess you want one person to manage favorites for all the users of Portal. In such a case you can achieve this without any development work using KM. Just follow the below steps:
    1. Create a folder in KM inside documents folder (Content Admin > KM content > documents), say Favorites.
    2. Create links (external/Internal) inside the folder.
    3. Create a KM navigation I view by name Favorites and edit the property Path to Initially Displayed Folder = /documents/favorites (your folder path in KM)
    4. Add this I view to your homepage and page to the subsequent role
    5. Assign the role to the user.
    It works like custom favorites for all users using which you can centrally control user favorites just by adding or removing links in the KM favorites folder.
    Regards,
    Santhosh

Maybe you are looking for

  • IPhone 3GS - The iPhone "iPhone" could not be restored. An unknown error occurred (1013)

    Hey everyone, First off, here are my specs: iTunes Version: 10.4.1.10 running on Windows 7 iPhone 3GS running 4.3.5 (not jailbroken) I'm going nuts with this issue with my iPhone 3GS. After messing around with my phone, I managed to put it into recov

  • Pivot table by formula?

    Hi, I have a strange client requirement, which I want to achieve without using a pivot table, if possible, as; - 1. Pivot tables may not be scaleable to the volume of data which I will ultimately have in the solution 2. I need to create two measures,

  • Setting Initial View of .PDF when exporting from ID

    Hi, I use 5.0.1 and upgrading is not an option due to the IT department - don't get me started! I have created a document in ID with Bookmarks to aid navigation when its converted to a PDF. In Acrobat 8.0 there is a feature to set the initial view to

  • Error Calling Stored Procedure Receiver adapter

    Hi Guys, I am trying to send data to a stored procedure SQL server R2 2008 from SAP PI7.11. Transport Protocol: JDBC2.0 Message Protocol : XMLSQLFORMAT I am able to read from same database using sender adapter. Name of SP:  InderTest Paramters in SP

  • How to upgrade 10.4.11 from a 10.5.6 DVD

    I've been programming since 1961, but Apple's EZness and lack of documentation is driving me nuts. It's "like insert disc and follow the on-screen instructions." Moreover, most posts assume there is NO 10.5.6 on DVD and so one is using Software Updat