Created
July 15, 2016 10:37
-
-
Save JanVidarElven/bb9046e4b944af0d42c47ad94cfc06ca to your computer and use it in GitHub Desktop.
Group On UPN Suffixes used in Active Directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Require the Active Directory PowerShell Module, installed with AD RSAT tools | |
Import-Module ActiveDirectory | |
# Group count of all UPN suffixes in your Active Directory | |
Get-ADUser -Filter * | Select UserPrincipalName, @{Name="UPNSuffix"; Expression={($_.UserPrincipalName.Split("@",2)[1])}} | Group UPNSuffix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment