Merging/Joining Get-aduser, Get-mailbox, and Get-mailboxstatistics

The other day, I was asked to provide an extract of all mailboxes in my exchange environment, along with attributes only available in other PS commands.

The below script provides the list (Get-Mailbox)along with a the sizes (Get-MailboxStatistics) and users’s associated dept(Get-User).

Hope it helps you.

Get-Mailbox -resultsize unlimited | sort-object | Select-Object DisplayName,PrimarySmtpAddress,@{n=”Size(KB)”;e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.totalItemsize}}, @{n=”ItemAcount”;e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.itemcount}},@{n=”Dept”;e={(get-aduser $_.name -properties department).department}} | export-csv mailboxout.csv

Windows 10 with Ubuntu now in public preview • The Register

Microsoft’s latest “Insider” Windows 10 preview Build 14316, includes now the Windows Subsystem for Linux along with a flurry of other new features.The addition of a Linux command-line to Windows was announced at Microsoft’s Build conference last week. The feature is aimed at developers, allowing them to use Linux utilities without having to run up a virtual machine or log into a remote system.Installing the Subsystem for Linux is a matter of first enabling Developer Mode, par of the Update and Security settings, and then selecting Linux from the Windows Features dialog. Once it is enabled, you can open a command prompt, type bash, and be prompted to install “Ubuntu on Windows”. The subsystem is then downloaded from the Windows Store.

Read on, source: Windows 10 with Ubuntu now in public preview • The Register

10 Most Dangerous Commands – You Should Never Execute On Linux

1. rm -rf CommandThe rm -rf command is one of the fastest way to delete a folder and its contents. But a little typo or ignorance may result into unrecoverable system damage. The some of options used with rm command are. rm command in Linux is used to delete files. rm -r command deletes the folder recursively, even the empty folder. rm -f command removes ‘Read only File’ without asking. rm -rf / : Force deletion of everything in root directory. rm -rf * : Force deletion of everything in current directory/working directory. rm -rf . : Force deletion of current folder and sub folders.

Read on, source: 10 Most Dangerous Commands – You Should Never Execute On Linux