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

Anuncios

Un pensamiento en “Office 365: How to get the number of messages posted in Office 365 Groups!

  1. Pingback: SharePoint & Office 365: Resumen de posts (IX)! | Pasión por la tecnología...

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s