Created
July 15, 2016 10:49
-
-
Save JanVidarElven/783295e9c4bc0da63cc71eb7833535c0 to your computer and use it in GitHub Desktop.
Group on UPN Suffixes used in Azure 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 Azure Active Directory PowerShell Module | |
Import-Module MSOnline | |
# Credential and Connect | |
$msolcred = Get-Credential | |
Connect-MsolService -Credential $msolcred | |
# Group count of all UPN suffixes in your Azure AD | |
Get-MsolUser -All | 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