[PS] C:> Import-Module MSOnline
[PS] C:> $credential = Get-Credential
[PS] C:> Connect-MsolService -Credential $credential
[PS] C:> $ExchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication "Basic" -AllowRedirection
[PS] C:> Import-PSSession $ExchangeSession
[PS] C:> Get-StaleMailboxDetailReport | Sort username -Unique | SELECT TenantName, UserName, WindowsLiveID, LastLogin, DaysInactive | Export-Csv c:relatoriosO365UsuariosInativos.csv
Um grande abraço e até o próximo artigo.