On this page you can find a dump of PowerShell scripts I have written, that might save you some time. Feel free to use as you like.
    
    
      
   
 | Get all computers from Active Directory that have a LAPs password and output to CSV | $Computers = Get-ADComputer -Filter * -Properties ms-Mcs-AdmPwd | where ms-Mcs-AdmPwd -ne $null $Computers | Sort-Object Name | Select Name | Export-Csv -NoTypeInformation \\myserver\csv\laps.csv | 
| Check O365 for folder in mailbox | Connect-ExchangeOnline -UserPrincipalName yourusername@domain.com Get-MailboxFolderStatistics -Identity mailbox@domain.com | ? FolderPath -match "/"|select name, folderpath, itemsinfolder, itemsinfolderandsubfolders | 
| Check O365 mailbox stats (size, item count) | $username = 'username@domain.com' Connect-ExchangeOnline -UserPrincipalName admin@domain.com Get-MailboxFolderStatistics -Identity $username |? Folderpath -in ('/Recoverable Items','/Top of Information Store')| select folderpath, foldersize, folderandsubfoldersize | 
| Get list of O365 users as CSV | Connect-MSOLService Get-MSOLUser -all | Select-Object DisplayName, UserPrincipalName, isLicensed | Export-CSV c:\temp\o356export.csv | 
| Export users from AD including Department, Title, Manager and Name | Get-ADUser -Filter * -Property DisplayName,Department,Manager,Title | Select Name,Department,Manager,Title | export-csv c:\temp\export.csv | 
| Disable Internet Explorer (IE) | Disable-WindowsOptionalFeature -FeatureName Internet-Explorer-Optional-amd64 –Online | 
