.\E201X_MBX_Tables.ps1 'hostname' 'username' 'password'
Applications Manager version 172900 and above:$Hostname = '<hostname>'
$ServerName = [System.Net.Dns]::gethostentry($Hostname).HostName
$ServerName
$so = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck
$exsession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "http://$ServerName/powershell" -AllowRedirection -Authentication Kerberos -Credential Get-Credential -SessionOption $so
(Attempt Kerberos authentication, if failed try below command for Basic Authentication)
$exsession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://$ServerName/powershell" -Authentication Basic -Credential Get-Credential -SessionOption $so
(If Basic Authentication fails, ensure above mentioned prerequisites are completed)
Import-PSSession $exsession -AllowClobber -DisableNameChecking | out-null
Get-MailboxDatabase
Get-Mailbox
$Hostname = '<hostname>'
$ServerName = [System.Net.Dns]::gethostentry($Hostname).HostName
$ServerName$ServerHostname = $ServerName.split(".")[0]
Get-MailboxDatabase -Server $ServerHostname -Status | Select-Object MasterType, MasterServerOrAvailabilityGroup, Name, Mounted,@{Name="MailboxCount";Expression={(Get-Mailbox -Database $_.name -ResultSize Unlimited).Count}},@{name="databasesize"; expression={[math]::Round(($_.databasesize.ToString().Split("(")[1].Split(" ")[0].Replace(",","")/1GB),2)}},@{name="availablenewmailboxspace"; expression={[math]::Round(($_.availablenewmailboxspace.ToString().Split("(")[1].Split(" ")[0].Replace(",","")/1GB),2)}}, LastFullBackup, @{name="age"; expression={(New-TimeSpan -Start $_.LastFullBackup -End $currentdate).Days}}, CircularLoggingEnabled | ConvertTo-Csv -Delimiter "|" -NoTypeInformation | % {$_.Replace('"','')} | select -skip 1
Get-DatabaseAvailabilityGroup
Get-MailboxDatabase -Server $ServerHostname -Status | Get-MailboxDatabaseCopyStatus | Select-Object name, Status, CopyQueueLength, ContentIndexState, LatestFullBackupTime, @{name="age"; expression={(New-TimeSpan -Start $_.LatestFullBackupTime -End $currentdate).Days}}, ActiveCopy | ConvertTo-Csv -Delimiter "|" -NoTypeInformation | % {$_.Replace('"','')} | % {$_.Replace('\','- ')} |select -skip 1
Get-Mailbox -Server $ServerHostname -ResultSize Unlimited -wa SilentlyContinue | Get-MailboxStatistics -wa SilentlyContinue | Sort-Object TotalItemSize -Descending | Select-Object -First 10 | Select-Object DisplayName,@{name="TotalItemSizeMB"; expression={[math]::Round(($_.TotalItemSize.ToString().Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},ItemCount | ConvertTo-Csv -Delimiter "|" -NoTypeInformation | % {$_.Replace('"','')} | select -skip 1
Get-Mailbox -Server $ServerHostname -ResultSize Unlimited -WarningAction SilentlyContinue |where {(!$_.name.startswith("SystemMailbox")) -and (!$_.name.startswith("FederatedEmail")) -and (!$_.name.startswith("DiscoverySearchMailbox"))}| Get-MailboxStatistics -WarningAction SilentlyContinue | Select-Object DisplayName,LastLogonTime, @{name="DaysSinceLogin"; expression={((Get-Date) - $_.LastLogonTime).Days}} | where DaysSinceLogin -gt 30 | Sort-Object DaysSinceLogin -Descending | ConvertTo-Csv -Delimiter "|" -NoTypeInformation | % {$_.Replace('"','')} | select -skip 1
Get-Queue | Select-Object Identity,DeliveryType,Status,MessageCount,Velocity,NextHopDomain | ConvertTo-Csv -Delimiter "|" -NoTypeInformation | % {$_.Replace('"','')} | % {$_.Replace('\','\\')} | select -skip 1