<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MattLog.net &#187; Email from PowerShell</title>
	<atom:link href="http://mattlog.net/tag/email-from-powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattlog.net</link>
	<description>Matts Admin Tips</description>
	<lastBuildDate>Wed, 21 Jul 2010 01:37:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Auto Email Exchange 2007 Mailbox Report</title>
		<link>http://mattlog.net/2009/03/12/auto-email-exchange-2007-mailbox-report/</link>
		<comments>http://mattlog.net/2009/03/12/auto-email-exchange-2007-mailbox-report/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 01:58:31 +0000</pubDate>
		<dc:creator>Matt Shadbolt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Email from PowerShell]]></category>
		<category><![CDATA[Email Report]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Mailbox Size]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://mattlog.net/?p=120</guid>
		<description><![CDATA[Hi all. I&#8217;ve written this simple PowerShell script to output your user mailboxes, their total size and the item count &#8211; the script will then email the output to a specified account in a pretty HTML table format. Feel free to download the .ps1 file and run it as you wish. Remember that you need [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all. I&#8217;ve written this simple PowerShell script to output your user mailboxes, their total size and the item count &#8211; the script will then email the output to a specified account in a pretty HTML table format. Feel free to download the .ps1 file and run it as you wish.</p>
<p>Remember that you need to &#8220;Set-ExecutionPolicy RemoteSigned&#8221; in the Task Scheduler for the PS script to run correctly. Also, if you are going to run this PS script on a remote server you <em>may</em> need to add the MSExchange PS Snappin. To do this just add &#8220;Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin&#8221; to the first line of the script. You obviously need to change the mail server and recipient options.</p>
<p>Here&#8217;s the script download <a href="http://mattlog.net/wp-content/uploads/2009/03/emailmailboxsizereport.ps1">EmailMailboxSizeReport.ps1</a></p>
<p>And a break down of the script:</p>
<blockquote><p>#Firstly, get the users mailbox&#8230; ONLY objects that are UserMailbox and not HiddenFromAddressListsEnabled<br />
$MailboxUser = Get-Mailbox | Where {($_.RecipientType -eq &#8220;UserMailbox&#8221;) -and ($_.HiddenFromAddressListsEnabled -eq $False)}</p>
<p>#Secondly, get the mailbox statistics for the selected users. Some formatting also<br />
$MessageBody = $MailboxUser | Get-MailboxStatistics | Sort-Object TotalItemSize | Select DisplayName, ItemCount, @{Expression={$_.TotalItemSize.Value.ToMB()};Name=&#8221;MailboxSize MB&#8221;} | ConvertTo-html</p>
<p>#Finally, enter your mail server details<br />
$FromAddress = &#8220;FromAddress@YourDomain.com&#8221;<br />
$ToAddress = &#8220;ToAddress@YourDomain.com&#8221;<br />
$MessageSubject = &#8220;PowerShell Report Subject&#8221;<br />
$SendingServer = &#8220;YourMailServerAddress&#8221;<br />
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $MessageBody<br />
$SMTPMessage.IsBodyHtml = $true<br />
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer<br />
$SMTPClient.Send($SMTPMessage)</p>
<p>#Written by Matt Shadbolt<br />
#http://www.mattlog.net</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mattlog.net/2009/03/12/auto-email-exchange-2007-mailbox-report/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
