Get-UserWithManyGroups by Dmitry Sotnikov 28 months ago
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/1385"></script>download | new post
Lists Active Directory user accounts which are members of too many groups, and can thus cause token bloat issues
- # Lists AD users who are members in too many groups
- # (c) Dmitry Sotnikov
- # Details at:
- # http://dmitrysotnikov.wordpress.com/2009/10/12/find-users-in-too-many-groups/
- # Uses free Quest AD cmdlets
- $limit = 75
- Get-QADUser -SizeLimit 0 -DontUseDefaultIncludedProperties |
- ForEach-Object {
- $groups = Get-QADGroup -ContainsIndirectMember $_.DN -SizeLimit $limit `
- -DontUseDefaultIncludedProperties -WarningAction SilentlyContinue
- if ($groups.Count -ge $limit) { $_ }
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
PowerShell Code Repository