10 useful Office 365 PowerShell snippets

Using the Windows Azure Active Directory Module connect toAzure AD using the following command.   Connect-MsolService   Enter your tenant credentials. (user@contoso.onmicrosoft.com)   1.Export to CSV all users that are licensed and have a specific UPN domain prefix.   Get-MsolUser -all |where {$_.isLicensed -And $_.UserPrincipalName.ToLower().EndsWith(“contoso.com”)} | Export-csv userTrue.csv   2.Export to CSV all users that…

4