locked
Powershell to Remove a user from all site collection RRS feed

  • Question

  • Hi All,

    I am looking for SharePoint powershell script to remove a user from all site collection and group with in a web application.

    It would be helpful if I can use user ID within that script, so that I will use it for other user as well.


    Santosh sethi

    Monday, September 2, 2013 1:21 PM

Answers

  • I'm guessing you mean to remove their permissions from all site collections?

    The simplest way might be to have a 'banned users' AD group, then to add that group to the Web Application policies with a deny all setting. That will override any site collection specific levels as well as blocking users named in AD groups. I don't know if/what the performance impact might be for large numbers of users.

    Otherwise you'd have to modify AD group membership, or not use those at all.

    • Marked as answer by star.wars Wednesday, September 11, 2013 7:20 AM
    Monday, September 2, 2013 1:29 PM
  • Hello,

    Try this script:

    http://sharepoint.stackexchange.com/questions/36421/remove-a-single-user-from-all-site-collections-in-a-web-application-using-powers

    Let us know your result


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by star.wars Wednesday, September 11, 2013 7:20 AM
    Tuesday, September 3, 2013 6:43 AM

All replies

  • I'm guessing you mean to remove their permissions from all site collections?

    The simplest way might be to have a 'banned users' AD group, then to add that group to the Web Application policies with a deny all setting. That will override any site collection specific levels as well as blocking users named in AD groups. I don't know if/what the performance impact might be for large numbers of users.

    Otherwise you'd have to modify AD group membership, or not use those at all.

    • Marked as answer by star.wars Wednesday, September 11, 2013 7:20 AM
    Monday, September 2, 2013 1:29 PM
  • Hello,

    Try this script:

    http://sharepoint.stackexchange.com/questions/36421/remove-a-single-user-from-all-site-collections-in-a-web-application-using-powers

    Let us know your result


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by star.wars Wednesday, September 11, 2013 7:20 AM
    Tuesday, September 3, 2013 6:43 AM