Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Need help with a Powershell Script to extract data from Exchange

$
0
0
I am trying to extract the following from Exchange 2010 in our environment into an Excel file with headings at the top for the data:

Mailbox Display Name

Primary Email Address

Last User Account to Access Mailbox

Last Login Time

Date of last message sent from mailbox

Item Count in Mailbox

Size of mailbox in MB or GBs

Export to a CSV on the c: drive.

We are in a domain with various sub-domains. I am trying to pull this information from one particular sub-domain and a couple of particular OUs within that sub-domain instead of pulling all mailboxes. Second, I want to be able to modify the script to pull globally from that sub-domain. Then, I want to be able to extract all of this information from the entire domain (subs included). What would these scripts look like? 

So far, I tried this script and was not able to get it to work:

Get-Mailbox -Database "OurSubDomain Database" | Get-MessageTrackingLog Timestamp -Last 1 | Get-MailboxStatistics | Format-Table LastLoggedOnUserAccount,LastLogOnTime,ItemCount,DisplayName,Database

I prefer to work with formatting as above as I am relatively new to PowerShell. Thanks. 

Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>