Office 365: How to get the number of messages posted in Office 365 Groups!

This time I’m sharing a really simple PowerShell script that allows to get the number of messages posted in all the Office 365 Groups in an Office 365 tenant. To get such statistics, the script uses Get-UnifiedGroup and Get-MailboxStatistics cmdlets. You can download the script from the following location: How to get the number of messages posted in all the Office 365 Groups

############################################################################################################################################

# Script that allows to get the number of messages posted in Office 365 Groups

# Required Parameters: N/A

############################################################################################################################################

 

#Definition of the function tthat allows to do work with Office 365 Groups using standard cmdlets for Groups

function ReadNumberMessagesPostedInOffice365Groups

{

    param ($sOperationType,$sGroupName,$sNewGroupName)       

    try

    {

        Write-Host "--------------------------------------------------------------------------------------"  -foregroundcolor Green

        Write-Host "Getting the number of messages posted in all Office 365 Groups in an Office 365 tenant" -foregroundcolor Green

        Write-Host "--------------------------------------------------------------------------------------"  -foregroundcolor Green

        Get-UnifiedGroup | Get-MailboxStatistics | Format-Table DisplayName, ItemCount, LastLogonTime

 

    }

    catch [System.Exception]

    {

        write-host -f red $_.Exception.ToString()

    }

}

$sUserName="juancarlos.gonzalez@fiveshareit.es"

$sMessage="Introduce your SPO Credentials"

$msolCred = Get-Credential -UserName $sUserName -Message $sMessage

$msolSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $msolCred -Authentication Basic -AllowRedirection

Import-PSSession $msolSession

 

ReadNumberMessagesPostedInOffice365Groups

Once you execute the script, you should get an output similar to the following one:

image

Office 365: Como obtener el # de mensajes posteados en Grupos de Office 365!

Si queréis obtener unas pequeñas estadísticas de los mensajes posteados en Grupos de Office 365, tendréis que recurrir a los comandos PowerShell para trabajar con Grupos. En concreto, tras iniciar una sesión de PowerShell contra Exchange Online basta con usar los cmdlets Get-UnifiedGroup y Get-MailboxStatistics para obtener dichas estadísticas: How to get the number of messages posted in all the Office 365 Groups

############################################################################################################################################

# Script that allows to get the number of messages posted in Office 365 Groups

# Required Parameters: N/A

############################################################################################################################################

 

#Definition of the function tthat allows to do work with Office 365 Groups using standard cmdlets for Groups

function ReadNumberMessagesPostedInOffice365Groups

{

    param ($sOperationType,$sGroupName,$sNewGroupName)       

    try

    {

        Write-Host "--------------------------------------------------------------------------------------"  -foregroundcolor Green

        Write-Host "Getting the number of messages posted in all Office 365 Groups in an Office 365 tenant" -foregroundcolor Green

        Write-Host "--------------------------------------------------------------------------------------"  -foregroundcolor Green

        Get-UnifiedGroup | Get-MailboxStatistics | Format-Table DisplayName, ItemCount, LastLogonTime

 

    }

    catch [System.Exception]

    {

        write-host -f red $_.Exception.ToString()

    }

}

$sUserName="juancarlos.gonzalez@fiveshareit.es"

$sMessage="Introduce your SPO Credentials"

$msolCred = Get-Credential -UserName $sUserName -Message $sMessage

$msolSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $msolCred -Authentication Basic -AllowRedirection

Import-PSSession $msolSession

 

ReadNumberMessagesPostedInOffice365Groups

La salida por pantalla correspondiente es la siguiente:

image