Get-Mailbox.Psm1

Function Get-mailbox()
{
$cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection
Import-PSSession $Session
Get-Mailbox|select Name,Alias,Database
}
 
Function Get-UnifiedGroups()
{
$cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection
Import-PSSession $Session
Get-UnifiedGroup |select Name,Alias,AccessType
}