none
Using Remove-SPOUser to remove "Everyone except external users" and "Everyone" from SharePoint groups

    Question


  • I am trying to remove "Everyone except external users" and "Everyone" from my SharePoint groups and replace them with an AD account. I tried using the command below as part of my script.
    The script is intended to loop through all the groups in a site collection and remove "Everyone except external users"

    Remove-SPOUser -Site $site -LoginName "spo-grid-all-users/2d24fbf8-f186-4d1b-bc5c-39bb9cde1baa" -Group $group.LoginName

    But this command does not work. I get the error in the screenshot below when I run this. 
    Am I using it wrong? Is there a better way to do accomplish what I need? Please help.

    

    Monday, March 6, 2017 10:17 PM

Answers

  • Finally figured it out. This worked for me.

    Remove-SPOUser -Site $site -LoginName "c:0-.f|rolemanager|spo-grid-all-users/2d24fbf8-f186-4d1b-bc5c-39bb9cde1baa" -Group $group.LoginName

    Tuesday, March 7, 2017 5:51 PM

All replies

  • Finally figured it out. This worked for me.

    Remove-SPOUser -Site $site -LoginName "c:0-.f|rolemanager|spo-grid-all-users/2d24fbf8-f186-4d1b-bc5c-39bb9cde1baa" -Group $group.LoginName

    Tuesday, March 7, 2017 5:51 PM
  • Hi Naveed,

    Thanks for your sharing.

    Best Regards,

    Victoria


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, March 8, 2017 12:56 PM
    Moderator