none
Remove all empty SharePoint Groups using PowerShell

    Question

  • Hello all,

    I have a lot of empty groups in our SharePoint farm, is there a way to delete all of them with powershell?

    I found a few scripts to delete a single group, but to delete all of them like that would take me 50 years or so it feels.

    Any helps would be appreciated.

    Thank you

    Tuesday, December 11, 2012 2:00 AM

Answers

  • Enumerate the groups, check the count of members and delete the ones with a count of zero.

    When you as groups in a sharepoint farm I think you are missing how a sharepoint server is built.  Groups are not part of the farm but are a part of a sharepoint site or site collection.

    I would start by posting in the Sharepoint 20xx forum and asking how to manage groups in a farm and in SharePoint. ONce you learn how to access the farm and its sites you can then get info on how to access users of a sharepoint site.,

    Here is a starter: http://technet.microsoft.com/en-us/library/fp161382.aspx

    Look at the definitions of 'farm' and 'site collection'.  Determine what verison of Sharepoint and PowerShell you have and lookup if it is possible to use PowerShell or will you heave to use the Sharepoint utilities.


    ¯\_(ツ)_/¯

    Tuesday, December 11, 2012 4:22 AM