Start-Transcript .\Exchange_external.log -Append

Get-DistributionGroup -Resultsize Unlimited | select-Object *Name*,Alias,Legacy*,PrimarySmtpAddress,RecipientType*,CustomAttribute* | export-csv .\All_DistributionGroup_external.csv -encoding utf8

$All_DistGroupMember = foreach ( $i in Get-DistributionGroup -Resultsize Unlimited ) { Get-DistributionGroupMember $i.DistinguishedName -Resultsize Unlimited | select-Object @{n="DistributionGroup";e={$i.DisplayName}},@{n="GroupAddress";e={$i.PrimarySmtpAddress}},DisplayName,PrimarySmtpAddress,RecipientType* }
$All_DistGroupMember | export-csv .\All_DistributionGroupMember_external.csv -encoding utf8

stop-Transcript

Start-Transcript .\Exchange_external.log -Append

Get-Mailbox -server "Exchange02" -Resultsize Unlimited | select-Object *Name*,Alias,*size*,Legacy*,Object*,PrimarySmtpAddress,RecipientType*,CustomAttribute* | export-csv .\DEXT1EXCHG001_Mailbox_external.csv -encoding utf8

stop-Transcript

Start-Transcript .\Exchange_external.log -Append

Get-Mailbox -server "Exchange02" -Resultsize Unlimited | Get-Mailboxstatistics | select-Object Displayname,*size*,Legacy*,LastLogonTime,MailboxType* | export-csv .\DEXT1EXCHG001_Mailboxstatistics_external.csv -encoding utf8


stop-Transcript