Friday, May 17, 2013

Pulling Enhanced Recipient Information from Exchange


Who is your daddy and what does he do?

I don’t like having to do inefficient repetitive tasks. There are situations where I want to pull specific information about a mailbox or a distribution group but I don’t want to have to look it up 5 different places in the GUI or type out the commands over and over again. This could be the user’s mailbox statistics, the ManagedBy list for distribution groups, a user’s ActiveSync device statistics, the mailbox features they have enabled, etc…

My solution 
A script that will grab a standard set of information regardless of the recipient type and the ability to supply additional parameters to grab additional information.

The basics of my script


  • Grabs the recipient object (Mailbox, Distribution Group, MailUser, Contact, etc…)
  • Mailbox
    • Name
    • Alias
    • Primary SMTP Address
    • Organizational Unit
    • City
    • Country or Region
    • Office
    • Company
    • Recipient Type Details (UserMailbox, RoomMailbox, LinkedMailbox, etc…)
    • Database
    • Hidden From Address Lists Enabled (Hidden from the GAL/OAB)
    • Mailbox Features
      • ActiveSync Enabled
      •  OWA Enabled
      • ECP Enabled
      • Emws Enabled
      •  POP Enabled
      •  Imap Enabled
      • MAPI Enabled
      • EWS Enabled
    • Any ActiveSync Device Statistics
    • Optional
      • Logon Statistics
      • Mailbox Statistics
      • Mailbox Quota Information
      • Mailbox Folder Statistics
      • Out of Office Configuration
      • Junk Email Configuration
  • Distribution Group (Dynamic or Regular)
    •  Primary SMTP Address
    • Recipient Type Details
    • Organizational Unit
    • When Created (UTC)
    • When Changed (UTC)
    • Managed By
    • Accept Messages Only From (“Allowed Senders”)
  • Mail User
    •  Name
    • Alias
    • Primary SMTP Address
    • Organizational Unit
    • City
    • Country or Region
    • Office
    • Company
    • Recipient Type Details (UserMailbox, RoomMailbox, LinkedMailbox, etc…)
    • Database
    • Hidden From Address Lists Enabled (Hidden from the GAL/OAB)
    •  External Email Address
  • Contact
    •  Name
    • Alias
    • Primary SMTP Address
    • Organizational Unit
    • City
    • Country or Region
    • Office
    • Company
    • Recipient Type Details (UserMailbox, RoomMailbox, LinkedMailbox, etc…)
    • Database
    • Hidden From Address Lists Enabled (Hidden from the GAL/OAB)
    • Windows Email Address

Here’s the script (Get-RecipientInformation

Example Usage

Variables      
·         Name 
    • The recipient alias, SamAccountName, or GUID. This should be as unique as possible.
·         Statistics [switch]
    • This will pull Mailbox, Logon and Folder Statistics for mailboxes
·        OOF [switch]
    • This will pull the Out of Office configuration for mailboxes
  • JunkEmail [switch]
    • This will pull the Junk Email configuration for mailboxes

 Mailbox

Get-RecipientInformation Han.Solo
-----------------------------------------
Recipient Information
-----------------------------------------

Name                          : Han Solo
Alias                         : Han.Solo
PrimarySmtpAddress            : LeiaIsMine@righthandedexchange.com
OrganizationalUnit            : righthandedexchange.com/Users
City                          : Hoth
CountryOrRegion               : Rebel Base
Office                        : Hanger Bay
Company                       : Rebel Alliance
RecipientTypeDetails          : UserMailbox
Database                      : Database-1138
HiddenFromAddressListsEnabled : False



-----------------------------------------
Mailbox Features
-----------------------------------------

ActiveSyncEnabled : False
OWAEnabled        : True
ECPEnabled        : True
EmwsEnabled       : False
PopEnabled        : True
ImapEnabled       : True
MAPIEnabled       : True
EwsEnabled        :



-----------------------------------------
ActiveSync Device Statistics
-----------------------------------------

DeviceFriendlyName  : Black iPhone 5
DeviceOS            : iOS 6.0.2 10A551
DeviceModel         : iPhone5C1
Status              : DeviceOk
StatusNote          :
LastSyncAttemptTime : 12/21/2012 1:46:08 AM
LastSuccessSync     : 12/21/2012 1:46:08 AM

Distribution Group

Get-RecipientInformation -Name RebelAlliance
------------------------------------------------------------
Distribution Group: RebelAlliance
------------------------------------------------------------
PrimarySmtpAddress   : DownWithTheEmpire@righthandedexchange.com
RecipientTypeDetails : MailUniversalDistributionGroup
OrganizationalUnit   : righthandedexchange.com/DistributionGroups
WhenCreatedUTC       : 8/26/2005 2:26:58 PM
WhenChangedUTC       : 4/23/2013 2:38:16 PM

ManagedBy
---------
Bail Organa

No comments:

Post a Comment