Hi
I need to knock together a list of all mail enabled users and their associate settings from their AD account (company, department, title, city, all that stuff). I need to include *ALL* their SMTP email addresses.
I'm really struggling to merge my get-mailbox query with my get-users query. Can someone help show me how to pipe get-users in to get-mailbox so that the email fields are populate for each user in turn?
Here are my two scripts, which both give me the separate information I need.
**********************
Get-User -ResultSize Unlimited | Where { $_.RecipientType -eq 'UserMailbox' } | ft displayname,firstname,lastname,samaccountname,department,city,description,title,company
Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}}
**********************
Thanks
Olly