Powershell: Count total messages to and from external domain

Hi All,
I'm attempting to get a count of total messages to and from our clients domains.  For example, @customer1.com 23.
So far, I have the following code
get-messagetrackinglog -start (Get-Date).adddays(-1) -resultsize unlimited |where-object {$_.EventID -eq
Send" -or $_.EventID -eq "Receive"}
What I'm looking for is the following:
If the Sender or the Recipient is NOT @ourcompanydomain.com, count total messages either sent or received from the domain.  Output to csv.
123.com, 53
456.com, 32
Any help would be greatly appreciated.
Brian
Syncronet

Ok, so I've made some progress and now have it so I get an accurate count of total messages.  Now I need to group them by @recipientdomain.com and have totals for each recipientdomain.com.  I also need to get the output correct.  
Add-PSSnapin Microsoft.Exchange.Management.Powershell.E2010 -ea silentlyContinue
[long]$IntSent=0
[long]$IntRec=0
[long]$IntTotal=0
$domain="extdomain.com"
get-messagetrackinglog -start (Get-Date).adddays(-1) -resultsize unlimited -Eventid Send| ForEach{$IntSent++}
get-messagetrackinglog -start (Get-Date).adddays(-1) -resultsize unlimited -EventID Receive |Where {[String]$_.recipients -notlike "*@mydomain.com*"}|ForEach{$IntRec++}
#write-host ($IntSent)
#Write-host ($IntRec)
$IntTotal=$IntSent + $IntRec
write-host ($IntTotal)
$table=@"
Domain,Messages
$domain,$IntTotal
$Table |set-content c:\temp\messages.csv
Any help is greatly appreciated.
Thanks
Brian
Syncronet
Directly loading in the snap in for Exchange 2010 and 2013 is not supported.
Please update scripts to use remoting:
http://blogs.technet.com/b/rmilne/archive/2015/01/28/directly-loading-exchange-2010-or-2013-snapin-is-not-supported.aspx
Cheers,
Rhoderick
Microsoft Senior Exchange PFE
Blog:
http://blogs.technet.com/rmilne 
Twitter:   LinkedIn:
  Facebook:
  XING:
Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Similar Messages

  • I need to print off messages to and from my cell

    i need to print off messages to and from my cell

    You report your problem as using Acrobat on a Mac. You've posted in the Reader forum for iOS.
    I've moved your question to the Creating, Editing and Exporting PDF forum which seems more appropriate.
    You'll need to provide more information for us to be able to help you.

  • Exchange 2013 SMTP Mail Flow from external domains

    I have query related to mail flow for incoming mails from external domains from Internet facing site. There are two sites - Site A & Site B. Both have Exchange 2013 CAS servers in NLB and Exchange 2013 Mailbox in individual DAG - say DAG1 in Site
    A and DAG2 in Site B. Site A is Internet facing site and site B is not Internet facing.
    An incoming Internet mail meant for recipient in Site B will land in Exchange 2013 CAS server in Site A. This CAS Server in Site A will look for the recipient in local Domain Controller and get to know the mailbox database of this recipient is in DAG2 (
    in site B ) Will the FET service in EX2013 CAS in Site A make a SMTP connection with FET service of EX2013 CAS in site B which will then make SMTP connection to EX2013 Mailbox server in Site B which is holding the recipient mailbox Active copy for delivery.
    OR
    EX2013 CAS will send this mail to Ex2013 Mailbox server in site A and the Hub Transport service running in in site A will then make SMTP connection with EX2013 Mailbox server in Site B which is holding the recipient mailbox Active copy
    Need clarification on above
    Thanks
    Parveen

    Hello,
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    I'm marking the reply as answer as there has been no update for a couple of days.
    If you come back to find it doesn't work for you, please reply to us and unmark the answer.
    Cara Chen
    TechNet Community Support

  • Cost of messaging to and from Canada with a prepaid phone

    Hi. I am going to be in Canada for four nights very soon. I have a prepaid plan that includes unlimited texting to and from all carriers. I was wondering if I were to send or receive text messages to people in the U.S. from Canada, would I be charged extra, or will cost the same ($0.00)? If I were to be charged extra, could you please also include the amount it would cost for each text? Thanks for any and all help

        Hi there TC17!
    You raise a great question here about texting Canada. After all, it's always better to be safe now and make sure you won't get charged any extra. So, I'm happy to expand.
    Based on most plans, texting to and from Canada is considered domestic and you would only be taking from your allowance. Given you're on a prepaid plan, you may wish to clarify exactly which plan you're on so you can get a definitive answer. To do so, please contact our prepaid department directly at 888-294-6804 as their plans, allowances, and capabilities often vary from here on the postpaid side. I hope this helps out a great deal!
    EvanO_VZW
    Follow us on Twitter @VZWSupport

  • Mountain Lion Mail randomly deletes messages: locally and from server

    Hello,
    Mountain Lion Mail deletes mails randomly, locally and from the IMAP server.
    I have confirmed this for a fact:
    - I have been forwarded lost mails to another (webmail) account: the timestamps indicate that some mails were lost somewhere before I ever saw them on Mail
    - my mail service provider confirmed that their logs show mails that I never saw on Mail
    - the lost mails don't appear via webmail, either, i.e. they're not on the server
    Others are experiencing the same in Lion:
    http://www.seifi.org/email/lion-mail-app-deletes-imap-emails-without-notice-gmai l-important-fix.html
    https://discussions.apple.com/thread/3206902
    I became aware of this as my customer referred on the phone to messages from them that I had never seen. And, Mail deletes messages randomly from the IMAP server too - it's literally eating messages!
    No, this is not a rule issue. No, this is not anything I could have done to cause. This should be evident as very many others are experiencing the same (see the above links).
    This is the worst bug I've ever encountered in any Apple product.
    Apple need to acknowledge this and address it, like, immediately.
    Is there a fix for this? One that works 100% - I really can't risk not receiving business e-mail.
    br Janne

    I'm experiencing something similar. I see a message being received in Mountain Lion via notification. When I'm going to look for this mail, it's gone.
    I dont't have any rules set up and no mail plugins installed. The mail is also vanished from the server. I'm using IMAP on my own web-site (via a service provider). I was able to verify, that a certain message from a certain sender dissapeard, which had a PDF attached. I thought it might have something to do with my ISPs virus protection, but they a) insured me, that they don't delete any mail and b) I got a new mail from someone I don't know this morning. Again: Saw the notification, afterwards the mail is gone.
    For now, I will switch to ThunderBird (this was also the recommendation of my ISP).
    Kind regards
    Marco Heine

  • Normal text messages to and from my iPad (through my iPhone 4S)!?

    Since iOS 8, I used to be able to send and receive normal texts, to and from people with non iPhone phones, on my iPad mini retina through me iPhone 4S, but since I changed my password of my Apple ID, this is NOT working anymore! iMessage texts, shows up on both devices, but the normal texts that my iPhone get, now doesn't show up on my iPad!??
    Actually it used to work with phonecalls as well, being relayed from my iPhone, showing up on my iPad, but thats not working either anymore!??
    Anybody knows whats up!? I really enjoyed this feature, so really hope someone can help me here!??
    Hardware:
    iPhone 4S (8.1.1... Just updated, and changed nothing)
    iPad mini retina (8.1.1... Just updated, and changed nothing)

    Fantastic!!!
    So simple, and so straight forward! You actually managed to solve 2 pending questions in here, in these forums, in one swoop! ;-) I had another question about all my linked photos, contacts and soforth in my imessage on my iPad that had disapeared! But the minute I got this set up, they all reappeared!! :-) But they must have changed it from default setting to now this little switch... since I don't remember that I have set this up before!!
    Anyhow... Thank you SO much!! :-)

  • Can't receive mail from external domains (hotmail, gmail, etc)

    Hi,
    I have a new problem
    I can't receive external email. The receive connector that i have is the following:
    Default Frontend NAME.NL
    TlS, Basic verification, Basic after TLS, Intergrated, Exchange verification. groups: Exchange-server,
    exchange-user and anon
    This should be enough to receive external mail right? If I test it with gmail or hotmail I get the message: Mail delayed

    Hi,
    Is there any update?
    Thanks.
    Niko Cheng
    TechNet Community Support
    Sadly no.
    I still don receive any mail from certain domains. And gmail still has a +/- 24 hour delay. We now didn't receive some important mail for 1 and a half week. Any more idea's. I'm totally out of ideas 

  • How to receive replies back to SAP user's inbox from external domain.

    We are facing a scenario where an email should be sent from SAP to any external domain ( ie: abc.com ) and  I know that we can trigger outgoing mail from SAP but not sure about receiving emails to a specific SAP User id's inbox (SBWP). I was searching some information from SAP notes and found one (SAP Note:- 455140) but not sure whether it's possible in our current version(R/3 release 4.6C). Please confirm ASAP since we have to decide a key functionality based on this.

    I have tried SCON -> Settings -> Inbound distribution.
    But my question is how does the system receive the reply from the external domain. We can execute the send process in the transaction SCOT. But how do we initiate the receive process ? When we send a email from SAP to some external domain eg. yahoo.com, the recepient of that mail would see the mail as coming from the address that is configured in the SAP user master record (Internet mail) of the sender. So when a reply to the original mail is sent, it would go to the email address of the sender that is mentioned in the "Internet Mail" field of the SAP user master record and not to the SAP User Inbox of the original sender.

  • Backing up and restoring library to and from external HD

    Newbie to iTunes since I got my iPhone. I'm asked periodically to back up my library to CDs. Can I back up per my question, and in the event of the unthinkable total crash of my Mac can I restore from the external HD? Is there a method to do this or some additional software necessary? I currently copy my iTunes folder to my external HD every time I add anything to iTunes.
    Thanks,
    CD3

    Yes, you can restore your music folder from a backup HD. Assuming the backup folder is organized exactly like the original, it would just be a matter of copying the backup folder into the position of the original. You can use a regular file backup program to automate the backup process. SuperDuper! is one; there are certainly others that have their fans.
    It's also a good idea to back up your iTunes Library file. A completely functioning iTunes music library is made up of the iTunes Library file and the associated iTunes Music folder. The library file is a directory file and contains vital data about the music library.

  • Why cant i send or receive picture messages to and from non iphone users?

    i have an iphone 4 and i cant send picture messages or receive them from non iphone users. what do i need to do?

    These headings should appear (in order) when you go to Settings > Messages:
    iMessage
    Send Read Receipts
    Send as SMS (the one I asked you to turn on in most recently)
    Send & Receive
    MMS Messaging (the one I asked you to turn on in the first post)
    Group Mesaging
    Show Subject Field
    Character Count
    Hopefully this is what you see.  Otherwise, please post a screen shot.

  • Copying to and from external drive causes Finder Freeze

    I recently purchased a Shintaro USB HD dock to archive my many Gigs of Video footage.
    I plug it all in and powered up without problems. Plugged a SATA disk into the dock it showed up (it was previously formated in an FW drive)
    The drive showed up on the desktop and the files on it were there as well. When I try to either copy files to or from the dock the copy window comes up works for about 40% of whatever file I'm copying and then Freezes.
    I've tried several disks and all do the same.
    I cannot relaunch the finder, I cannot stop the process in Activity monitor, all I can do is power down, restart and try again.
    I have tried using both a USB hub and hooked direct to the USB card in my PowerMac but the same thing happens everytime.
    When I look at the external drive it has all the icons there but all the files are Zero Bytes.
    Anybody got any ideas ?

    Hi Brett,
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Tiger Install disc that came with your computer, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    Use Disk Utility to Repair the external drives.
    While still in Safe Mode, move these files to the Desktop...
    /Users/YourUserName/Library/Preferences/com.apple.finder.plist
    /Users/YourUserName/Library/Preferences/com.apple.systempreferences.plist
    /Users/YourUserName/Library/Preferences/com.apple.desktop.plist
    /Users/YourUserName/Library/Preferences/com.apple.recentitems.plist
    Reboot & test.

  • Repeatly passing data to and from external program

    I'm looking for some help to get me started.  I'm willing to bet
    the info is here I'm just not sure what to look for and my searches
    aren't reveiling anwsers. 
    Background: I'm trying to take control of a device that is comunicating
    through the PCI bus.  The device has a set of API dll's that I can
    access through C++, but not directly in LabVIEW.  So wish to creat
    a wrapper program that will give LabVIEW indirect access to the
    dlls.  
    Problem: I've breifly read up on CINs and Libaray call functions and
    have found one underlying problem with both.  I have not found a
    way to pass data back and forth between the external code and LabVIEW
    once the external code is running.  I require an interactive
    conection between the two. 
    Any sugestions of what to search for would be greatly appreatiated, or even how to resolve my problem.
    Thank you.
    Don't get even, get odd!

    If the data buffers are owned by the driver and are updated asynchronously, you should expose that buffer to LabVIEW as a handle (simple int32 for the pointer to the buffer). This can then be passed to the wrapper code and checked (implements your polling). Remember that handling tasks in LV that should run in parallel is different from C++ however - you don't create threads, instead you should simply set up independent loops.
    I'm not sure what else to suggest since I don't fully understand what the API does or what the HW is doing, so feel free to post more information if you want more suggestions
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • Sending picture messages to, and from, my Nokia Lu...

    I am pay as you go with Vodafone but am unable to send or receive picture messages.
    Vodafone say that in the phone 'settings' there should be the options mms APN and edit APN but these are not on the menu.
    Any suggestions please?

    go to settings > access point
    When first started it will find the settings for yoru carrier and show them as active. Alternatively you can add manual APN here for internet and MMS
    Click on the blue Star Icon below if my advice has helped you or press the 'Accept As Solution' link if I solved your problem..

  • Counting Total No.of Idocs received in BPM

    Hi Experts,
                   My scenario is " I am getting three different Idocs from three interfaces. Now i want to count total number of idocs from all the interfaces and compare this count with the one of the idoc field(Which contains the total number of idocs send from the sender) if the count matches then i have to send this idocs to the receivers."
                   I have done the configuration as follows
    1.Fork step with three branches
    2.Loop, inside the loop Receive step,Container operation step with the property Assign for counting and one more container operation step for Appending.
    3.Transformation step
    4.Send step
            While doing this i am getting individual idoc counts but i want the sum of these three interfaces count. How can i get the count of all three interfaces.
            Can you please let me know.
    Thanks & Regards,
    Purushotham
    Edited by: Purshothamm Thenepalli on Aug 5, 2008 5:32 AM

    If you want to count every time u get an IDoc irrespective of the sender, you need to use multiple receiver steps for receiving each type of idoc and then count.
    It will be almost like a collect pattern at the receiving part in BPM.
    VJ
    Edited by: VijayaShankar Konam on Aug 4, 2008 11:53 PM

  • How to Setup RDS custom property when internal and external domain name space is different

    Hi All
    I am setting up RDS for customer
    My internal domain name is domain.local and my external domain is domain.com
    I came across below PowerShell cmdlets on some blogs because my internal and external name space are different
    Set-RDSessionCollectionConfiguration –CollectionName QuickSessionCollection -CustomRdpProperty “use redirection server name:i:1 `n alternate full address:s:remote.domain.com”
    In above command, remote.domain.com points to which host?
    Is it pointing to RD Session Broker
    OR
    Pointing to RD Session Host servers
    I am not sure what above command will do exactly ?
    Any help will be highly appreciated
    Thanks Best Regards Mahesh

    Hi,
    It all depends who is accessing the RDS Solution.
    If you have a large BYOD or large number of external users, it would be better to use a public certificate.
    Have a look at the following script which will simplyfy the configuration of the RDSH hosts with certificates.
    http://ryanmangansitblog.com/2014/05/20/rds-2012-rdsh-certificate-deployment-script/
    You can use a custom RDP property to hide the Session host names.
    Have a look at the following article on configuring certificates:
    http://ryanmangansitblog.com/2013/03/10/configuring-rds-2012-certificates-and-sso/
    Ryan Mangan | Ryanmangansitblog.wordpress.com | Help keep the forums tidy, if this has helped please mark it as an answer

Maybe you are looking for

  • 75 characters length EDITABEL field in my_alv_report?

    Hello I am trying to keep a 75 characters length EDITABEL cell/field in my_heiracrhial_alv_report, but, its allowing me to do only 40 charactares length!! Pls. let me know how can i get 75 lenght EDITABEL field in my_heiracrhial_alv_report Thank you.

  • Assignment of Serial No to the customer other then we sold the goods !!

    Hi All, My Scenario is channel business where my client sells the machine with serial no. to his distributors, Now the distributor is selling the machine to end user. Now our client wants the machine serial no. should be assigned to the end user inst

  • BAPI BAPI_OUTB_DELIVERY_CREATE_STO  cannot work in BAdI  DELIVERY_PUBLISH

    Hi Experts: In BAdI  DELIVERY_PUBLISH  Method PUBLISH_AFTER_SAVE. I called BAPI BAPI_OUTB_DELIVERY_CREATE_STO to create a new delivery when PGI for one exist delivery by referring to a PO. I test this FM in SE37 and it has no problem, but in the BAdi

  • How can i creat a "book"

    i have microsoft office but i can figure out how to make a document where it takes an 8 1/2 by 11, landsape, print on both sides and make it into colums. if anybody could help me that would be great!

  • Linking 2 computers with Logic node, anyone try it?

    Has anyone established a way to utilize 2 computers side by side to share the processing with logic? I have a macbook intell and a non intell mac mini, can anyone advise on this set up?