I need some PowerShell assistance. Boss has asked me to get the email address of everyone she’s emailed in the last year. The list will also need to be deduplicated. Can anyone help?<\/p>","upvoteCount":4,"answerCount":12,"datePublished":"2020-12-16T12:38:09.000Z","author":{"@type":"Person","name":"davecork","url":"https://community.spiceworks.com/u/davecork"},"acceptedAnswer":{"@type":"Answer","text":"

\n
\n
<\/div>\n\"\" davecork:<\/div>\n
\n
Advertisement

I need some PowerShell assistance. Boss has asked me to get the email address of everyone she’s emailed in the last year. The list will also need to be deduplicated. Can anyone help?<\/p>\n<\/blockquote>\n<\/aside>\n

Advertisement

What email solution do you guys use? On prem Exchange, O365, something else?<\/p>\n

With O365 you can run a eDiscovery search to get that data.
\nhttps://www.codetwo.com/admins-blog/message-tracking-office-365/<\/a><\/p>\n

e.g.<\/p>\n

Start-HistoricalSearch -ReportTitle \"Trace1\" -ReportType MessageTrace -SenderAddress [email protected] -StartDate 11/01/2017 -EndDate 11/07/2017 -NotifyAddress [email protected]\n<\/code><\/pre>","upvoteCount":1,"datePublished":"2020-12-16T15:35:31.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/8","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},"suggestedAnswer":[{"@type":"Answer","text":"

I need some PowerShell assistance. Boss has asked me to get the email address of everyone she’s emailed in the last year. The list will also need to be deduplicated. Can anyone help?<\/p>","upvoteCount":4,"datePublished":"2020-12-16T12:38:09.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/1","author":{"@type":"Person","name":"davecork","url":"https://community.spiceworks.com/u/davecork"}},{"@type":"Answer","text":"

This might help: Use PowerShell to Data Mine Your Outlook Sent Items - Scripting Blog [archived]<\/a><\/p>","upvoteCount":1,"datePublished":"2020-12-16T13:13:32.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/2","author":{"@type":"Person","name":"DoctorDNS","url":"https://community.spiceworks.com/u/DoctorDNS"}},{"@type":"Answer","text":"

Please excuse the bluntness, but we are not a script writing service. We’re happy to help, but we do expect you to have at least started something on your own. So, with that in mind, what have you tried so far?<\/p>\n

PLEASE READ BEFORE POSTING! Read if you’re new to the PowerShell forum!<\/a><\/p>\n

Use the <> Insert Code button in the forums editor to format your code appropriately.
\n\"Capture.png\"<\/p>","upvoteCount":0,"datePublished":"2020-12-16T13:13:39.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/3","author":{"@type":"Person","name":"patrickdeno2","url":"https://community.spiceworks.com/u/patrickdeno2"}},{"@type":"Answer","text":"

\n
\n
<\/div>\n\"\" GhillieHammer:<\/div>\n
\n

Please excuse the bluntness, but we are not a script writing service. We’re happy to help, but we do expect you to have at least started something on your own. So, with that in mind, what have you tried so far?<\/p>\n

PLEASE READ BEFORE POSTING! Read if you’re new to the PowerShell forum!<\/a><\/p>\n

Use the <> Insert Code button in the forums editor to format your code appropriately.<\/p>\n<\/blockquote>\n<\/aside>\n

That’s a fair answer. I’m not asking anyone to perform a script writing service. My hope was that someone would have a framework I could start with and then tweak to my needs. @thomaslee<\/a> ​ was quite helpful by just sending that link. I was merely asking if someone would share their expertise.<\/p>","upvoteCount":0,"datePublished":"2020-12-16T14:15:48.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/4","author":{"@type":"Person","name":"davecork","url":"https://community.spiceworks.com/u/davecork"}},{"@type":"Answer","text":"

\n
\n
<\/div>\n\"\" davecork:<\/div>\n
\n
\n
\n
<\/div>\n\"\" GhillieHammer:<\/div>\n
\n

Please excuse the bluntness, but we are not a script writing service. We’re happy to help, but we do expect you to have at least started something on your own. So, with that in mind, what have you tried so far?<\/p>\n

PLEASE READ BEFORE POSTING! Read if you’re new to the PowerShell forum!<\/a><\/p>\n

Use the <> Insert Code button in the forums editor to format your code appropriately.<\/p>\n<\/blockquote>\n<\/aside>\n

That’s a fair answer. I’m not asking anyone to perform a script writing service. My hope was that someone would have a framework I could start with and then tweak to my needs. tfl​ was quite helpful by just sending that link. I was merely asking if someone would share their expertise.<\/p>\n<\/blockquote>\n<\/aside>\n

Please don’t take any offense at the above. I honestly wasn’t trying to be rude. But, you’d be surprised just how often we get folks who join Spiceworks because they heard somewhere online that we’ll do free programming work, and then disappear after getting their answer, never to be seen again. It’s nothing personal, it’s just the usual caveat we tend to have to open with. It makes us sound like d*cks, but is actually far more helpful in the long run to all involved. I’m actually kind of surprised @alexw<\/a> ​ didn’t beat me to the punch. chuckle<\/em> He’s one of our resident PowerShell gawds and he’s usually the first to post the same form answer.<\/p>","upvoteCount":0,"datePublished":"2020-12-16T14:21:54.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/5","author":{"@type":"Person","name":"patrickdeno2","url":"https://community.spiceworks.com/u/patrickdeno2"}},{"@type":"Answer","text":"

\n
\n
<\/div>\n\"\" GhillieHammer:<\/div>\n
\n
\n
\n

Please don’t take any offense at the above. I honestly wasn’t trying to be rude. But, you’d be surprised just how often we get folks who join Spiceworks because they heard somewhere online that we’ll do free programming work, and then disappear after getting their answer, never to be seen again. It’s nothing personal, it’s just the usual caveat we tend to have to open with. It makes us sound like d*cks, but is actually far more helpful in the long run to all involved. I’m actually kind of surprised Neally​ didn’t beat me to the punch. chuckle<\/em> He’s one of our resident PowerShell gawds and he’s usually the first to post the same form answer.<\/p>\n<\/blockquote>\n<\/blockquote>\n<\/blockquote>\n<\/aside>\n

Understood. I’ve been around Spiceworks for a while and have witnessed the same thing. (I usually hang around in the Windows Servers, Routers, Networking and similar areas.) No offense taken. Maybe one of the things you could do when weeding out the freeloaders is look at their spiciness… If they’re not a pimiento, that means they’ve been around for a bit. That’s one of the things I try to do. I’m willing to work harder for someone who’s contributed to Spiceworks. YMMV.<\/p>","upvoteCount":0,"datePublished":"2020-12-16T14:31:27.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/6","author":{"@type":"Person","name":"davecork","url":"https://community.spiceworks.com/u/davecork"}},{"@type":"Answer","text":"

\n
\n
<\/div>\n\"\" davecork:<\/div>\n
\n
\n
\n
<\/div>\n\"\" GhillieHammer:<\/div>\n
\n
\n
\n

Please don’t take any offense at the above. I honestly wasn’t trying to be rude. But, you’d be surprised just how often we get folks who join Spiceworks because they heard somewhere online that we’ll do free programming work, and then disappear after getting their answer, never to be seen again. It’s nothing personal, it’s just the usual caveat we tend to have to open with. It makes us sound like d*cks, but is actually far more helpful in the long run to all involved. I’m actually kind of surprised Neally​ didn’t beat me to the punch. chuckle<\/em> He’s one of our resident PowerShell gawds and he’s usually the first to post the same form answer.<\/p>\n<\/blockquote>\n<\/blockquote>\n<\/blockquote>\n<\/aside>\n

Understood. I’ve been around Spiceworks for a while and have witnessed the same thing. (I usually hang around in the Windows Servers, Routers, Networking and similar areas.) No offense taken. Maybe one of the things you could do when weeding out the freeloaders is look at their spiciness… If they’re not a pimiento, that means they’ve been around for a bit. That’s one of the things I try to do. I’m willing to work harder for someone who’s contributed to Spiceworks. YMMV.<\/p>\n<\/blockquote>\n<\/aside>\n

Agreed, and good advice. However, in my defense, you asked for help without posting anything you had already tried, and didn’t go into much detail about how you wanted it to work. While @thomaslee<\/a> ​ did post a helpful link - and kudos to him for that timely and extremely helpful post<\/em> - you didn’t exactly specify what kind of help you were looking for. In this group that usually equates to, “I want someone to write a script for me,” hence the response. Notice that I also shared a link to a stickied post about the expectations of this group. That was me trying to be helpful as well, despite being blunt. Please don’t feel like the Lone Stranger, here. Pretty much everyone gets this kind of reception when first asking for help, because few actually read that stickied post I mentioned before posting, themselves. It’s pretty much a given at this point. Again, I apologize for my bluntness, but you’d be surprised just how often such caveats are necessary. I’m sure you’ve seen the same sort of behavior in the circles you run in as well.<\/p>","upvoteCount":0,"datePublished":"2020-12-16T14:46:15.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/7","author":{"@type":"Person","name":"patrickdeno2","url":"https://community.spiceworks.com/u/patrickdeno2"}},{"@type":"Answer","text":"

@patrickdeno2<\/a> ​, no worries… we’re all good.<\/p>","upvoteCount":0,"datePublished":"2020-12-16T15:54:56.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/9","author":{"@type":"Person","name":"davecork","url":"https://community.spiceworks.com/u/davecork"}},{"@type":"Answer","text":"

\n
\n
<\/div>\n\"\" Neally:<\/div>\n
\n
\n

What email solution do you guys use? On prem Exchange, O365, something else?<\/p>\n<\/blockquote>\n

With O365 you can run a eDiscovery search to get that data.
\n
https://www.codetwo.com/admins-blog/message-tracking-office-365/<\/a><\/p>\n

e.g.<\/p>\n

Start-HistoricalSearch -ReportTitle \"Trace1\" -ReportType MessageTrace -SenderAddress [email protected] -StartDate 11/01/2017 -EndDate 11/07/2017 -NotifyAddress [email protected]\n<\/code><\/pre>\n<\/blockquote>\n<\/aside>\n

Sorry… should have been clear… Office 365. Appreciate the guidance.<\/p>","upvoteCount":0,"datePublished":"2020-12-16T15:56:33.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/10","author":{"@type":"Person","name":"davecork","url":"https://community.spiceworks.com/u/davecork"}},{"@type":"Answer","text":"

Another option would be use VBA code directly in outlook<\/p>\n

Here is a link that might get you started.<\/p>\n

https://bit.ly/2J1eoZy<\/a><\/p>\n

You can also search google of how to run VBA code in outlook<\/p>\n

Hope this helps.<\/p>","upvoteCount":0,"datePublished":"2020-12-16T18:17:28.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/11","author":{"@type":"Person","name":"6232529","url":"https://community.spiceworks.com/u/6232529"}},{"@type":"Answer","text":"

Thanks to all of you for steering me in the right direction. I REALLY appreciate it!<\/p>","upvoteCount":0,"datePublished":"2020-12-16T18:29:44.000Z","url":"https://community.spiceworks.com/t/script-to-export-email-address-of-all-sent-emails/785001/12","author":{"@type":"Person","name":"davecork","url":"https://community.spiceworks.com/u/davecork"}}]}}