<?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>LDC - LoPo dot com &#187; Windows</title>
	<atom:link href="http://www.lopo.com/category/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lopo.com</link>
	<description>Back to Basics or Something</description>
	<lastBuildDate>Fri, 09 Sep 2011 00:00:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>#Exchange 2010 &amp; 2007 &#8211; Control POP3 Enablement per Mailbox</title>
		<link>http://www.lopo.com/2011/07/28/exchange-2010-control-pop3-enablement-per-mailbox/</link>
		<comments>http://www.lopo.com/2011/07/28/exchange-2010-control-pop3-enablement-per-mailbox/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 03:00:43 +0000</pubDate>
		<dc:creator>John Barsodi</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[2007]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[ActiveSync]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://www.lopo.com/?p=278</guid>
		<description><![CDATA[<p>Last year I wrote a basic control script to manage Exchange 2007 Active Sync enablement.  Recently, I had a need to write an extremely simple POP3 control enablement script.  The main difference is this just set to run in an Exchange 2010 environment utilizing 2010 PowerShell Snapin.  Functionally and logically it&#8217;s all the same.  The script is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lopo.com/wp-content/uploads/2011/07/pop3icon.jpg"><img class="alignright size-full wp-image-282" title="pop3icon" src="http://www.lopo.com/wp-content/uploads/2011/07/pop3icon.jpg" alt="" width="124" height="114" /></a>Last year <a title="#Exchange 2007ActiveSync: Control Which Users Are Enabled…Automagically" href="http://www.lopo.com/2011/01/10/exchange-20072010-activesync-control-which-users-are-enabled-automagically/">I wrote a basic control script to manage Exchange 2007 Active Sync enablement</a>.  Recently, I had a need to write an extremely simple POP3 control enablement script.  The main difference is this just set to run in an Exchange 2010 environment utilizing 2010 PowerShell Snapin.  Functionally and logically it&#8217;s all the same.  The script is designed to run via a Scheduled Task or interactively(yes I kept the <a href="http://www.windowsitpro.com/blog/powershell-with-a-purpose-blog-36/scripting-languages/what-to-do--not-to-do-in-powershell-part-1-137475" target="_blank">dreaded Write-host</a> lines).</p>
<p><em>UPDATE:  I&#8217;ve included a 2007 version below the 2010 version.</em></p>
<p>The same prerequisites exist from the EAS script.</p>
<p>Prerequisites:</p>
<ol>
<li>Create a Universal security group</li>
<li>From the EMS, get the GUID for the newly created group
<pre class="brush: powershell; title: ; notranslate">Get-group 'Group Name' | Select GUID</pre>
<p>I wanted to use the GUID to prevent the script from breaking in the event someone changed the group name.</li>
</ol>
<p>You will need to populate the $grpguid variable with the GUID you obtain from Prerequisite #2. Once complete, schedule to run on a machine that has the Exchange cmdlets and you will be off and running.  Once you want to control who is enabled, simply populate the group  that you created in Prerequisite #1 with users who&#8217;ve been approved to utilize POP3.</p>
<h2>Exchange 2010 Version:</h2>
<pre class="brush: powershell; title: ; notranslate">
##########################################################################
# ScriptName: Set-POP3.ps1
# Author:     John Barsodi
# Date:       07/24/11
# Version:    .1
# Desc:       Disables the POP3 feature to False if not member of
# Desc:       the AD group &lt;Enter Your Group Name&gt;
# Tags:       Group POP Exchange 2010
##########################################################################
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
Set-ADServerSettings -ViewEntireForest $true
$grpGuid  = &quot;YourGroupGUIDHere&quot;
$grpdn = (Get-group $grpGuid).DistinguishedName
$grpBind = [ADSI]&quot;LDAP://$grpdn&quot;
$members = $grpBind.Member
$EnabledPOP = (Get-CasMailbox -resultsize unlimited | where {$_.POPEnabled -eq &quot;True&quot;})
Foreach ($obj in $EnabledPOP){
	$UserDN = $obj.DistinguishedName
	$UserDisplayName = $obj.Name
  		If($members -contains $UserDN){
    		Write-Host -ForegroundColor Green &quot;$UserDisplayName found in Group&quot;
   		}
  		Else{
   			Set-CasMailbox $UserDisplayName -POPEnabled $false
   			Write-Host -ForegroundColor Red &quot;$UserDisplayName not found in Group, POP Disabled.&quot;
  		}
}
</pre>
<h2>Exchange 2007 Verison:</h2>
<pre class="brush: powershell; title: ; notranslate">
##########################################################################
# ScriptName: Set-POP3.ps1
# Author:     John Barsodi
# Date:       07/24/11
# Version:    .1
# Desc:       Disables the POP3 feature to False if not member of
# Desc:       the AD group &lt;Enter Your Group Name&gt;
# Tags:       Group POP Exchange 2007
##########################################################################
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
$AdminSessionADSettings.ViewEntireForest = $True
$grpGuid  = &quot;YourGroupGUIDHere&quot;
$grpdn = (Get-group $grpGuid).DistinguishedName
$grpBind = [ADSI]&quot;LDAP://$grpdn&quot;
$members = $grpBind.Member
$EnabledPOP = (Get-CasMailbox -resultsize unlimited | where {$_.POPEnabled -eq &quot;True&quot;})
Foreach ($obj in $EnabledPOP){
	$UserDN = $obj.DistinguishedName
	$UserDisplayName = $obj.Name
  		If($members -contains $UserDN){
    		Write-Host -ForegroundColor Green &quot;$UserDisplayName found in Group&quot;
   		}
  		Else{
   			Set-CasMailbox $UserDisplayName -POPEnabled $false
   			Write-Host -ForegroundColor Red &quot;$UserDisplayName not found in Group, POP Disabled.&quot;
  		}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lopo.com/2011/07/28/exchange-2010-control-pop3-enablement-per-mailbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>#PowerShell and WMI to Determine OS Architecture for Automation</title>
		<link>http://www.lopo.com/2011/04/12/powershell-and-wmi-to-determine-os-architecture-for-automation/</link>
		<comments>http://www.lopo.com/2011/04/12/powershell-and-wmi-to-determine-os-architecture-for-automation/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 00:35:00 +0000</pubDate>
		<dc:creator>John Barsodi</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.lopo.com/?p=242</guid>
		<description><![CDATA[<p>I&#8217;m in the process of writing some of the more complicated PowerShell code I&#8217;ve ever written to automate some laborious tasks at my new job.  The process I generally like to take when writing something like this is to modularize parts/steps of the automation as standalone components to be reused and consumed elsewhere.</p> <p>Part of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the process of writing some of the more complicated PowerShell code I&#8217;ve ever written to automate some laborious tasks at my new job.  The process I generally like to take when writing something like this is to modularize parts/steps of the automation as standalone components to be reused and consumed elsewhere.</p>
<p>Part of what I&#8217;m automating requires running installation of software.  This software comes in 32-bit and 64-bit flavors, so picking the correct install bits is very important.  In searching for &#8220;the best&#8221; way to determine installed OS Architecture, it became very apparent that Admins out there were relying on, what I would characterize as, error prone methods.  I needed something that would work on Windows Server 2003, 2008, 2008 R2.  Yes I&#8217;m aware that 2008 R2 is x64 only, that makes things easier, but I need to have a streamlined and solid method of checking, regardless of what system is running the install task.</p>
<p>Starting with the Vista/Server 2008 , a new property was introduced to the <a href="http://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx" target="_blank">win32_OperatingSystem</a> class, called OSArchitecture which makes this relatively trivial.  However, I want something that will work on 2003 if needed.</p>
<p>I started looking at other WMI classes to find a reliable way to determine, without having to rely on parsing text strings of a Caption property or other various methods.  I ended up finding the <a href="http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx" target="_blank">win32_Processor </a>class and found a quick and easy solution &#8211; the AddressWidth and/or Architecture properties.  The Architecture property would be ideal if looking for Architectures other than 32/64-bit.</p>
<p>Below is the extremely simple snippet to perform this check against the first and sometimes *only* CPU installed. I know I had very limited reliable information out there on this, so I hope this helps someone in the future.</p>
<pre class="brush: powershell; title: ; notranslate">
#region OS detection
$proc = get-wmiobject win32_processor | where {$_.deviceID -eq &quot;CPU0&quot;}
	If ($proc.addresswidth -eq '64')
		{
		$OSArch = '64-Bit'
		}
	ElseIf ($proc.addresswidth -eq '32')
		{
		$OSArch = '32-Bit'
		}
#endregion OS detection
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lopo.com/2011/04/12/powershell-and-wmi-to-determine-os-architecture-for-automation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>So I Resigned From My Pretty Awesome Job.</title>
		<link>http://www.lopo.com/2011/03/14/so-i-resigned-from-my-pretty-awesome-job/</link>
		<comments>http://www.lopo.com/2011/03/14/so-i-resigned-from-my-pretty-awesome-job/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 19:40:21 +0000</pubDate>
		<dc:creator>John Barsodi</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[me]]></category>
		<category><![CDATA[mobility]]></category>

		<guid isPermaLink="false">http://www.lopo.com/?p=213</guid>
		<description><![CDATA[<p>On Friday 3/4, I resigned from my current job as IT Systems Architect/Team Lead for our Systems and Messaging group. It was one of the more difficult decisions I&#8217;ve made in my ~12 year IT career. It&#8217;s hard to leave a company who has treated you well. In 4.5 years with them, I&#8217;ve been promoted [...]]]></description>
			<content:encoded><![CDATA[<p>On Friday 3/4, I resigned from my current job as IT Systems Architect/Team Lead for our Systems and Messaging group.  It was one of the more difficult decisions I&#8217;ve made in my ~12 year IT career.  It&#8217;s hard to leave a company who has treated you well.  In 4.5 years with them, I&#8217;ve been promoted twice, given additional responsibilities, and selected for unique and challenging projects.  Weighing this decision literally took a physical toll on me while I hashed it out and waited to provide my resignation.  I&#8217;ve accomplished a lot and have much to be proud of and hope to continue that success on my future projects.  Looking forward&#8230;.  I&#8217;m heading to a Cloud! Service provider and will be on their Exchange Team, implementing and supporting both shared and dedicated platforms including their mobility offerings.  This in itself is exciting as I&#8217;ve been working with MS Mail/Exchange since I started in IT.  I also hope to help this company productize Lync Server 2010 as well.  I&#8217;m excited as this new role will force me to <a href="http://www.lopo.com/2010/12/31/hay-its-december-31st-time-for-some-new-years-resolutions/">obtain those certifications I wanted to pursue in 2011</a>.  Oh yeah, my new job is 100% work from home.  I&#8217;m pretty excited about that too.</p>
<p>I get to meet my new team in a next week.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lopo.com/2011/03/14/so-i-resigned-from-my-pretty-awesome-job/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>#Exchange 2007ActiveSync: Control Which Users Are Enabled&#8230;Automagically</title>
		<link>http://www.lopo.com/2011/01/10/exchange-20072010-activesync-control-which-users-are-enabled-automagically/</link>
		<comments>http://www.lopo.com/2011/01/10/exchange-20072010-activesync-control-which-users-are-enabled-automagically/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 05:01:13 +0000</pubDate>
		<dc:creator>John Barsodi</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[2007]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[ActiveSync]]></category>
		<category><![CDATA[Windows Mobile]]></category>

		<guid isPermaLink="false">http://www.lopo.com/?p=161</guid>
		<description><![CDATA[<p>Last year when we launched support for Windows Mobile 6.x devices via Exchange ActiveSync, I had a challenge of making sure only approved users were enabled for ActiveSync support. By default in Exchange(all versions), all mailboxes are enabled for ActiveSync, and specifically with Exchange 2007 when the CAS role is installed into the Organization. I [...]]]></description>
			<content:encoded><![CDATA[<p>Last year when we launched support for Windows Mobile 6.x devices via Exchange ActiveSync, I had a challenge of making sure only approved users were enabled for ActiveSync support. By default in Exchange(all versions), all mailboxes are enabled for ActiveSync, and specifically with Exchange 2007 when the CAS role is installed into the Organization. I decided to write this quick script to fix this &#8216;feature&#8217; and would allow me to run interactively or via the task scheduler.</p>
<p>Prerequisites:</p>
<ol>
<li>Create a Universal security group</li>
<li>From the EMS, get the GUID for the newly created group
<pre class="brush: powershell; title: ; notranslate">Get-group 'Group Name' | Select GUID</pre>
<p>I wanted to use the GUID to prevent the script from breaking in the event someone changed the group name.</li>
</ol>
<p>You will need to populate the $grpguid variable with the GUID you obtain from Prerequisite #2. Once complete, schedule to run on a machine that has the Exchange cmdlets and you will be off and running.  Once you want to control who is enabled, simply populate the group  that you created in Prerequisite #1 with users who&#8217;ve been approved to utilize ActiveSync.</p>
<pre class="brush: powershell; title: ; notranslate">
###############################################
# ScriptName: Set-EAS.ps1
# Author:     John Barsodi
# Date:       1/12/10
# Version:    .1
# Desc:       Sets the EAS Mailbox feature to False if not member of
# Desc:       the AD group &lt;Enter Your Group Name&gt;
# Tags:       Group EAS
###############################################
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
$AdminSessionADSettings.ViewEntireForest = $True
$grpGuid  = &quot;YourGroupGUIDHere&quot;
$grpdn = (Get-group $grpGuid).DistinguishedName
$grpBind = [ADSI]&quot;LDAP://$grpdn&quot;
$members = $grpBind.Member
$EnabledEAS = (Get-CasMailbox -resultsize unlimited | where {$_.ActiveSyncEnabled -eq &quot;True&quot;})
Foreach ($obj in $EnabledEAS){
	$UserDN = $obj.DistinguishedName
	$UserDisplayName = $obj.Name
  		If($members -contains $UserDN){
    		Write-Host -ForegroundColor Green &quot;$UserDisplayName found in Group&quot;
   		}
  		Else{
   			Set-CasMailbox $UserDisplayName -ActiveSyncEnabled $false
   			Write-Host -ForegroundColor Red &quot;$UserDisplayName not found in Group&quot;
  		}
}
</pre>
<p>You can download the script here: <a href="http://www.lopo.com/wp-content/uploads/2011/01/set-eas.txt">set-eas.txt</a></p>
<p>Feel free to leave any questions in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lopo.com/2011/01/10/exchange-20072010-activesync-control-which-users-are-enabled-automagically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hay it&#8217;s December 31st, time for some New Years Resolutions&#8230;</title>
		<link>http://www.lopo.com/2010/12/31/hay-its-december-31st-time-for-some-new-years-resolutions/</link>
		<comments>http://www.lopo.com/2010/12/31/hay-its-december-31st-time-for-some-new-years-resolutions/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 18:14:38 +0000</pubDate>
		<dc:creator>John Barsodi</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Cisco UCS]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[certification]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Lync]]></category>
		<category><![CDATA[me]]></category>
		<category><![CDATA[smartphone]]></category>
		<category><![CDATA[teched]]></category>

		<guid isPermaLink="false">http://www.lopo.com/?p=133</guid>
		<description><![CDATA[<p>Well.. I run 1920&#215;1200 resolution at home and 3 monitors at 1600&#215;1200 at work&#8230; think I will strive for 2560&#215;2048 and 1920&#215;1200 respectively. ok that was lame.</p> <p>I never make New Years resolutions because I&#8217;ve always thought they were pitfalls for failure and most of the time forgotten by January 21st.  However, this year I have some [...]]]></description>
			<content:encoded><![CDATA[<p>Well.. I run 1920&#215;1200 resolution at home and 3 monitors at 1600&#215;1200 at work&#8230; think I will strive for 2560&#215;2048 and 1920&#215;1200 respectively. ok that was lame.</p>
<p>I never make New Years resolutions because I&#8217;ve always thought they were pitfalls for failure and most of the time forgotten by January 21st.  However, this year I have some goals that I want to pursue and what better way to wrap them up than by claiming them as New Years resolutions?</p>
<p><strong>The obligatory &#8220;Get into shape and lose x number of pounds&#8221;. </strong> Actually, I want to work on my conditioning the first 6 months of 2011 as I want to start training in July for a marathon in January 2012.  It&#8217;s a Rock&#8217;n Roll marathon in Phoenix, AZ and I ran it in 2005.  My goal is to improve on my 2005 time by 1hr 10 mins, but I will be satisfied with dropping 40 mins.   Developing a schedule and sticking to it will be critical.<br />
<strong><br />
Professional Growth</strong>.  I&#8217;m now the Team Lead/Architect for my group.  I touch a number of major technologies.  I want to get certified in the technologies that I spend the most amount of time with.  I&#8217;ve always had the opinion of &#8220;meh&#8221; when it comes to IT Certifications, but I&#8217;ve recently had a different outlook on taking a test and striving to complete the certification that aligns with your experience as something you <strike>have</strike> should do to remain attractive in the job market and validate your skills and experience to your current employer.</p>
<p>Two areas of technology excite me and I believe they are the direction of the industry and this is where I&#8217;ll focus over the next 12 months.</p>
<p><strong>Messaging, Collaboration(UCC), and Mobility</strong> &#8211; Exchange 2007/2010, Office Communication Server 2007/Lync Server 2010, Email Archiving,  BlackBerry Enterprise Server, GOOD Technology, iOS, BlackBerry, Android, and Windows Phone 7.</p>
<p>2011 Goal: Achieve MCITP status for <a href="http://www.microsoft.com/learning/en/us/certification/cert-exchange-server.aspx#ema2010" target="_blank">Exchange 2010</a> and <a href="http://www.microsoft.com/learning/en/us/certification/mcitp.aspx#tab2" target="_blank">Lync 2010</a>.  I&#8217;m still debating about finishing my Exchange 2007 MCITP status.  I have 1 of the 3 required tests complete.  I don&#8217;t think it&#8217;d be terribly difficult to study up and pass the remaining two.</p>
<p><strong> CLOUD!</strong> &#8211;  Vmware &amp; Hyper-V R2, Cisco UCS, Storage, and Management tools.</p>
<p>2011 Goal: Work towards <a href="http://mylearn.vmware.com/mgrReg/plan.cfm?plan=12457&amp;ui=www_cert" target="_blank">VCP status</a>, training budget pending of course.  VMware requires a mandatory 5 day class before you can take the test.</p>
<p>Here&#8217;s to a successful 2011!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lopo.com/2010/12/31/hay-its-december-31st-time-for-some-new-years-resolutions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>#PowerShell #Exchange Script for Messaging Tracking Logs Per User Stats</title>
		<link>http://www.lopo.com/2010/08/09/powershell-exchange-script-for-messaging-tracking-logs-per-user-stats/</link>
		<comments>http://www.lopo.com/2010/08/09/powershell-exchange-script-for-messaging-tracking-logs-per-user-stats/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 17:30:15 +0000</pubDate>
		<dc:creator>John Barsodi</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://www.lopo.com/?p=61</guid>
		<description><![CDATA[<p>A few months ago I was working on collecting some statistics out of our Exchange environment.  I wanted to take a few samples of user specific message traffic to help with some sizing calculations and just do a sanity check on our existing usage.  I know there are other tools and utilities that exist, but I wanted [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago I was working on collecting some statistics out of our Exchange environment.  I wanted to take a few samples of user specific message traffic to help with some sizing calculations and just do a sanity check on our existing usage.  I know there are other tools and utilities that exist, but I wanted try to write my own.  As a result, I added and defined the following requirements for this particular script:</p>
<ol>
<li>Hand it over to a Helpdesk Analyst and have the output make sense to them</li>
<li>Consume the script logic into a much larger health and status check on a per user basis script.</li>
<li>Make it possible for the scripts executor to have no knowledge of the Exchange environment other than having the Exchange Management tools installed.</li>
</ol>
<p>A few challenges arose during this process:</p>
<ol>
<li> A multi-site Exchange environment requires Site &amp; Hub Transport discovery of the site that the mailbox is homed.  If you were a Helpdesk Analyst you most likely wouldn&#8217;t know this information.</li>
<li> There could be multiple Hub Transport servers in a site and message tracking events could exist on both.</li>
<li>Performance hit on the Hub Transport servers in the event 30 days was opt&#8217;d for.</li>
</ol>
<p>I&#8217;m not going to include the entire script in the body of this post, you can download it at the bottom, but I want to call out a few sections:</p>
<p>The logic behind the Site &amp; Hub Transport discovery</p>
<p>Here is the cross selection of the script that requests the SMTP Address of the user who you want to report against.  From here we determine the Mailbox server and correlating AD Site.  Once we&#8217;ve determined the site we can then grab a list of Hub Transport servers to query against.</p>
<pre class="brush: powershell; title: ; notranslate">
$user = Read-Host &quot;What is the users email address?&quot;
$MbxServer = (get-mailbox $user).Servername
$Site = (Get-exchangeserver $MbxServer).site.name
$SiteHTServers = Get-Exchangeserver | Where {($_.IsHubTransportServer -eq $true) -and ($_.site.name -like &quot;$Site&quot;)}
</pre>
<p>The second and last second piece of logic I wanted to focus on is the use of a <a href="http://technet.microsoft.com/en-us/library/ff730937.aspx" target="_blank">Switch statement</a> which was new to me.  I&#8217;ve used Case statements in VB programming in my past, so it was relatively easy to understand.  Essentially we are defining variables based the $DateInput variable which is the value the user enters interactively for the number of days.</p>
<pre class="brush: powershell; title: ; notranslate">
switch ($DateInput)
    {
        1 {
           $StartDate = $today
           $Days = 1
           $SizeFactor = &quot;1KB&quot;
           $SizeLabel = &quot;KB&quot;
           break;
          }
        2 {
           $StartDate = (get-date).adddays(-7).ToString(&quot;MM/dd/yyyy&quot;)
           $Days = 7
           $SizeFactor = &quot;1MB&quot;
           $SizeLabel = &quot;MB&quot;
           break;
          }
        3 {
           $StartDate = (get-date).adddays(-14).ToString(&quot;MM/dd/yyyy&quot;)
           $Days = 14
           $SizeFactor = &quot;1MB&quot;
           $SizeLabel = &quot;MB&quot;
           break;
          }
        4 {
           $StartDate = (get-date).adddays(-30).ToString(&quot;MM/dd/yyyy&quot;)
           $Days = 30
           $SizeFactor = &quot;1GB&quot;
           $SizeLabel = &quot;GB&quot;
           break;
          }
        default {
           &quot;** The selection could not be determined **&quot;;
           break;
          }
    }
</pre>
<p>You can download the full script here: <a href="http://www.lopo.com/wp-content/uploads/2010/08/get-messagetracking.txt">get-messagetracking.txt</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lopo.com/2010/08/09/powershell-exchange-script-for-messaging-tracking-logs-per-user-stats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>#PowerShell Date Countdown Fun</title>
		<link>http://www.lopo.com/2010/08/02/powershell-date-countdown-fun/</link>
		<comments>http://www.lopo.com/2010/08/02/powershell-date-countdown-fun/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 19:40:26 +0000</pubDate>
		<dc:creator>John Barsodi</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://www.lopo.com/?p=50</guid>
		<description><![CDATA[<p>The other day I was trying to figure out how much longer until my anniversary date at work.  I figured I could open my Outlook calendar and start counting, but then I said, I bet this is easier to do in PowerShell!  So I goofed around and came up with the following.  I&#8217;m sure you [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was trying to figure out how much longer until my anniversary date at work.  I figured I could open my Outlook calendar and start counting, but then I said, I bet this is easier to do in PowerShell!  So I goofed around and came up with the following.  I&#8217;m sure you could add a few more lines and loop through it to build a countdown script&#8230;</p>
<p>Here&#8217;s an example of how to use it.  Let&#8217;s say my anniversary date was October 1, 2010 or &#8220;10/01/10&#8243; for this example.</p>
<p>First we want to figure out what today is using the Get-Date cmdlet.  Then we want to define our anniversary date and then take the difference of the two.</p>
<pre class="brush: powershell; title: ; notranslate">
$today = Get-Date
$anniversary = &quot;10/01/10&quot;
[datetime]$anniversary - $today
</pre>
<p>This will generate output like similar to this:</p>
<blockquote>
<div id="_mcePaste">Days              : 59</div>
<div id="_mcePaste">Hours             : 11</div>
<div id="_mcePaste">Minutes           : 30</div>
<div id="_mcePaste">Seconds           : 49</div>
<div id="_mcePaste">Milliseconds      : 80</div>
<div id="_mcePaste">Ticks             : 51390490805093</div>
<div id="_mcePaste">TotalDays         : 59.4797347281169</div>
<div id="_mcePaste">TotalHours        : 1427.51363347481</div>
<div id="_mcePaste">TotalMinutes      : 85650.8180084883</div>
<div id="_mcePaste">TotalSeconds      : 5139049.0805093</div>
<div id="_mcePaste">TotalMilliseconds : 5139049080.5093</div>
</blockquote>
<div>While that might produce you what you want with a lot of information you don&#8217;t, you can simply use the Days property to output the number of days remaining.</div>
<div>
<pre class="brush: powershell; title: ; notranslate">
$today = Get-Date
$anniversary = &quot;10/01/10&quot;
([datetime]$anniversary - $today).days
</pre>
</div>
<div>Which will return:</div>
<div>
<blockquote>
<div>PS C:\&gt; ([Datetime]$anniversary &#8211; $Today).days</div>
<div>59</div>
</blockquote>
</div>
<div>Pretty simple.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.lopo.com/2010/08/02/powershell-date-countdown-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TechEd 2010 &#8211; Day 2 &amp; 3</title>
		<link>http://www.lopo.com/2010/06/10/teched-2010-day-2-3/</link>
		<comments>http://www.lopo.com/2010/06/10/teched-2010-day-2-3/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 19:45:23 +0000</pubDate>
		<dc:creator>John Barsodi</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[teched]]></category>

		<guid isPermaLink="false">http://www.lopo.com/?p=43</guid>
		<description><![CDATA[<p>Just noticed this was never published.  Publishing&#8230;..</p> <p>TechEd thus far has been great.  Meet some really smart people, got a lot of information, and had some fun along the way.</p> Day 2 <p>I spent much all of the day in Hyper-V related sessions.  I have to say I&#8217;m really impressed with the capabilities and performance stats [...]]]></description>
			<content:encoded><![CDATA[<p><em>Just noticed this was never published.  Publishing&#8230;..</em></p>
<p>TechEd thus far has been great.  Meet some really smart people, got a lot of information, and had some fun along the way.</p>
<h1><strong>Day 2</strong></h1>
<p>I spent much all of the day in Hyper-V related sessions.  I have to say I&#8217;m really impressed with the capabilities and performance stats that Hyper-V R2 brings to the table.   We were introduced to the new SP1 features as well, including Dynamic Memory and RemoteFX.</p>
<p>I went offsite to an HP research event for Exchange Architects.  It was an NDA event, so I can&#8217;t state what we spoke about and saw as it relates to HP, but I did enjoy talking to the other participants.  There were approximately 12 of us, with infrastructures ranging from 25 users and a couple with 100,000+ users, discussing how we&#8217;ve deployed 2007/2010 and comparing notes.  It&#8217;s always good to hear how the large user count shops deploy.</p>
<p>After the conference I attended <a href="http://www.doubletake.com/" target="_blank">DoubleTake</a> &amp; <a href="http://www.riverbed.com" target="_blank">Riverbed&#8217;s</a> ClusterFunk party at <a href="http://www.republicnola.com/" target="_blank">The Republic</a>.  They had a band, <a href="http://www.doubletake.com/misc/lp-clusterfunk.aspx" target="_blank">Clusterfunk</a>, which is actually composed of DoubleTake&#8217;s employee&#8217;s including the CEO.</p>
<h1>Day 3</h1>
<p>I began Day 3 with two of the more technical sessions I attended during the entire show.  Hyper-V Performance Analysis followed by Exchange 2010 High Availability Deep Dive.  I was mentally spent after both of these sessions, but took away some great information.</p>
<p>I followed these sessions up with some Hands on Labs.  I focused mainly on PowerShell, Failover Clustering, and Hyper-V.   I found the labs to be ok but a tad bit short.  Given there were 192 different labs available, I understand the brevity of the labs themselves.  Microsoft had a repeating presentation on the infrastructure hosting the labs.  All powered and automated on Hyper-V and  HP hardware.  It was definitely impressive.</p>
<p>After the conference I attended <a href="http://www.quest.com/" target="_blank">Quest&#8217;s</a> Tweetup at Bourbon Street Blues Company.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lopo.com/2010/06/10/teched-2010-day-2-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TechEd 2010 &#8211; Day 1</title>
		<link>http://www.lopo.com/2010/06/09/teched-2010-day-1/</link>
		<comments>http://www.lopo.com/2010/06/09/teched-2010-day-1/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 13:20:55 +0000</pubDate>
		<dc:creator>John Barsodi</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[teched]]></category>

		<guid isPermaLink="false">http://www.lopo.com/?p=39</guid>
		<description><![CDATA[<p>Day 1 was quite the experience.  From the huge amounts of attendees trying to walk, and ultimately coming to a halt, in a 25 foot wide hallway of session conference rooms, to getting to participate on an Exchange round table at the Rustynail with members of Exchange product team.</p> <p>Sessions</p> <p>﻿This is my first time [...]]]></description>
			<content:encoded><![CDATA[<p>Day 1 was quite the experience.  From the huge amounts of attendees trying to walk, and ultimately coming to a halt, in a 25 foot wide hallway of session conference rooms, to getting to participate on an Exchange round table at the <a href="http://www.therustynail.org/" target="_blank">Rustynail</a> with members of Exchange product team.</p>
<p><strong>Sessions</strong></p>
<p><strong>﻿</strong>This is my first time attending TechEd so I wasn&#8217;t quite sure what to expect.  I had heard mainly good things about it, but some &#8220;eeehhh&#8221; things.<br />
After getting my Starbucks &#8211; they have one INSIDE the convention center &#8211; YES! &#8211; I found my seat in the jam packed keynote hall . Things started off with the Keynote which was lead by Microsoft&#8217;s Bob Muglia.  You can catch a web reply version <a href="http://www.msteched.com/2010/NorthAmerica/Keynote01" target="_blank">here</a>.  I, along with other attendees, thought it was a bit drawn out and could have been condensed.  There was two cool technologies that were demoed; The next version of Office Communications Server &#8211; rebranded as Microsoft Communications Server 2010.  We&#8217;re looking at deploying this when it RTM&#8217;s later this fall.  The client is extremely simplified for the users and eash to understand &#8211; something that hasn&#8217;t been Microsoft&#8217;s strong point.  They also demoed parts of the System Center Suite, namely Virtual Machine Manager 2011 Beta, which appears to bring a bucket full of new features.  It ended with Microsoft&#8217;s Tony Scott, their CIO, who isn&#8217;t presenter material.  I think his monotone voice put half the hall to sleep.</p>
<p>Following the keynote there were foundational sessions, none of which were interesting, so I opt&#8217;d to hit the exhibition floor and pick up swag.  Yup, the recession is over, vendors are giving away T-shirts regularly and offering varying raffles of Netbooks, iPads, and Xbox 360&#8242;s.</p>
<p>My afternoon was spent in breakout sessions.  Two were good, one, not so much.  Surprising the one that sucked was around automating IT with PowerShell &#8211; which I thought would have been great.  Let me explain, the subject is good, the presentation wasn&#8217;t.</p>
<p><strong>Post Sessions</strong></p>
<p>After the final session, there was an Exhibit Reception which was a way to get and keep attendees talking and providing vendors with the oh so important contact information to receive spam post conference.  I will say, offering tons of food and an open bar is a great way to achieve this.</p>
<p>After the Exhibition Reception, I headed over to the Exchange Roundtable that Jeff Guillet from <a href="http://www.expta.com" target="_blank">Expta.com</a> put together with about 20-25 other Exchange crazies.  He arranged for members of the Exchange product team to attend and participate in our discussions, notably <a href="http://msexchangeteam.com/archive/2005/08/25/409819.aspx" target="_blank">Ross Smitth IV</a> and <a href="http://blogs.technet.com/b/scottschnoll/" target="_blank">Scott Schnoll</a>.  It was a great evening and I enjoyed talking to the folks that attended.  There was a gentlemen that I actually didn&#8217;t get his name, but he was from Sweden and 1 of 5 <a href="http://www.microsoft.com/learning/en/us/certification/master.aspx" target="_blank">Microsoft Certified Masters</a> &#8211; Exchange 2010 in the world.  He shared that experience amongst many others.</p>
<p>Good times.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lopo.com/2010/06/09/teched-2010-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

