- Run PoweShell as administrator.
- Run Login Office 365 command: $UserCredential = Get-Credential
- Run session command: $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
- Run import session commnad: Import-PSSession $Session -DisableNameChecking
- List the mailboxes status command: get-mailbox
Here are the example:
PS C:\WINDOWS\system32> $UserCredential = Get-Credential
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
PS C:\WINDOWS\system32> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
PS C:\WINDOWS\system32> Import-PSSession $Session -DisableNameChecking
ModuleType Version Name ExportedCommands
———- ——- —- —————-
Script 1.0 tmp_rvd1ddlw.lfb {Add-AvailabilityAddressSpace, Add-DistributionGroupMember, Add-MailboxFolderPermission, Add-MailboxLocation…
PS C:\WINDOWS\system32> get-mailbox
Name Alias Database ProhibitSendQuota ExternalDirectoryObjectId
—- —– ——– —————– ————————-
administrator administrator NAMPR07DG132-db078 49.5 GB (53,150,2… 4e7c632d-ea2c-40ba-8628-3eaa3dc63e62