QuickBlog: PowerShell – Extracting email … to use COM Object or .NET code…

As you have notice with my previous sample COMObject vs .NET, that is looks the same.  So, as one of the PowerShell MVP college (Marco Shaw) pointed out on an email to me, that “… .NET just wrapped COM for Office programming” and this is true.   Now, there’s a reason why I went two ways on my QuickBlogs:

1. Both sample works on my computers (Windows 7 RTM 64bit and Windows Vista Business 32bit).  And that’s awesome!!

2. I have a SQL Server Admin college that wanted me to help him with the script but was having an error using the COMobject sample.

He’s on a Windows 7 64bit with Outlook 2007 installed and here’s error message he was getting:

Error: “New-Object : Retrieving the COM class Factory for component with CLSID {0006F03A—0000-0000-C000-000000000046} failed due to the following error: 80080005…}

His “Outlook.Application” COMobject was not loading.  So, I provided him with the .NET version of the script and he was able to extract and produce his email list from his Inbox.

In this case, the .NET code was the solution bypass the problem.   Still simple and powerful.

Advertisements

About maxt2posh

I’m from Puerto Rico, have been working with computers since 1979. Throughout many years, I have worked with SQL Server Technologies, provided support to Windows Servers/Client machines, Microsoft Virtualization Technologies, and build some Visual Studio solutions. I’m a Microsoft PowerShell MVP since 2009 and MVP SAPIEN Technologies since 2010. I speak in most of the SQLSaturday, IT Pro and .NET camps events around the Florida’s State. Also founder of the Florida PowerShell User Group which meeting every 3rd Tuesday evening of the month.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s