Display Exchange Online mailbox information with Office 365 PowerShell


Exchange online powershell
Microsoft online Exchange powershell
Microsoft online Exchange powershell

Display microsoft Exchange Online mailbox information with Office 365 PowerShell

Display Exchange Online mailbox information with Office 365 PowerShell

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic –AllowRedirection
Import-PSSession $Session
Remove-PSSession $Session

Display Microsoft Exchange Online mailbox information with Office 365 PowerShell

Get-Mailbox -Identity username

Get-Mailbox -Identity Username | Select-Object *

Or

Get-Mailbox -Identity username | FL 
They are the same

Get-Mailbox -Identity username | Select-Object DisplayName, LitigationHoldEnabled, LitigationHoldDate, LitigationHoldOwner, LitigationHoldDuration

  • -eq for equals (an exact match)
  • -ne for not equals (not an exact match)
  • -gt for greater than
  • -lt for less than

Where-Object

Get-Mailbox | Where-Object {$_.}

Get-Mailbox | Where-Object {$_.LitigationHoldEnabled -eq $True}

For junk email report for users

Get-Mailbox | Get-MailboxJunkEmailConfiguration | Where-Object {$_.Enabled -eq $False}

Or

Get-Mailbox –Identity username | Get-MailboxJunkEmailConfiguration | Fl

Get-MailTrafficTopReport

Get-MailTrafficTopReport -StartDate 12/04/2016 -EndDate 12/05/2016 | Sort-Object -Property count | FT >d:\spammers.csv

As another example, this command returns only those cmdlets that include the word Junk somewhere in the cmdlet name:

Get-Command -Name “*Junk*” -Module $modName

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.