Link to home
Create AccountLog 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
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Pistols at dawn Chris :)