<?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; microsoft</title>
	<atom:link href="http://www.lopo.com/tag/microsoft/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 #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 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>

