Link to home
Start Free TrialLog in
Avatar of Christian Hans
Christian HansFlag for United States of America

asked on

Combining Get-Mailbox and Get-MailboxStatistics in PowerShell

I am wanting to run a one liner in PowerShell by combining these two commands... how can I have them both run and export to a CSV output?

Get-Mailbox -ResultSize Unlimited | select Database,LitigationHoldEnabled,IsMailboxEnabled,ResetPasswordOnNextLogon,SamAccountName,ServerName,Office,UserPrincipalName,WhenMailboxCreated,Alias,DisplayName,HiddenFromAddressListsEnabled,PrimarySmtpAddress,RecipientTypeDetails,OrganizationalUnit

Get-MailboxStatistics | Select DisplayName,LastLogonTime,ServerName,DatabaseName

| Export-CSV c:\report.csv -notrypeinformation

Thanks in advance
SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Pistols at dawn Chris :)