<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Federated Infrastructure</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/anthonw/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/anthonw/feed.xml</link>
    <description>A discussion on politics, architecture, random experiences and good cheer from the Microsoft field.</description>
    <lastBuildDate>Tue, 16 Apr 2019 04:41:25 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Old Guys and Outlook Contact Cards</title>
      <link>https://docs.microsoft.com/archive/blogs/anthonw/old-guys-and-outlook-contact-cards</link>
      <pubDate>Tue, 21 May 2013 09:02:39 GMT</pubDate>
      <dc:creator><![CDATA[Anthony Witecki]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anthonw/2013/05/21/old-guys-and-outlook-contact-cards/</guid>
      <description><![CDATA[I am not a huge fan of the contact card feature in Outlook 2010 and later. I find the old-fashioned,...]]></description>
      <content:encoded><![CDATA[<p>I am not a huge fan of the contact card feature in Outlook 2010 and later. I find the old-fashioned, multi-tabbed dialog box far more functional and easier to read. Perhaps I am just old and resistant to change. Whatever the reason, I recently reached the end of my patience with the feature and decided to pursue the registry edits necessary to change it. Turns out, it's pretty easy to do. Just make the following changes in the current user hive of your registry. You're back to the Outlook of old and you can still bring up the contact card by pressing the actions button on your contact card.</p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier;">[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\15.0\common\contactcard]</span><br /><span style="font-family: courier new,courier;">"TurnOnLegacyGALDialog"=dword:00000001</span><br /><span style="font-family: courier new,courier;">"TurnOffHoverFunctionality"=dword:00000001</span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Autodiscover.xml failed (0x80004005) and BPOS</title>
      <link>https://docs.microsoft.com/archive/blogs/anthonw/autodiscover-xml-failed-0x80004005-and-bpos</link>
      <pubDate>Wed, 21 Mar 2012 14:32:27 GMT</pubDate>
      <dc:creator><![CDATA[Anthony Witecki]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anthonw/2012/03/21/autodiscover-xml-failed-0x80004005-and-bpos/</guid>
      <description><![CDATA[A customer contacted to report a problem with Outlook's AutoDiscover feature. The customer was a...]]></description>
      <content:encoded><![CDATA[<p>A customer contacted to report a problem with Outlook's AutoDiscover feature. The customer was a former BPOS customer that was testing some mailboxes deployed onto a new on-premises environment. The testExchangeConnectivity validation tool was reporting consistent results, so it appeared to be client related, but given the general complexity of the environment (domains, networks, VPNs, etc.), we felt it necessary to first rule out the server as an issue. The connectivity checker for Outlook was running the Autodiscover test and returning the following results on the log tab.</p>
<p>Local autodiscover for myserver.gov failed (0x8004010F)<br />Redirect check to http://myserver.gov/autodiscover/autodiscover.xml starting<br />Svr Record Lookup for http://myserver.gov/autodiscover/autodiscover.xml failed (0x80004005)</p>
<p>Initially, we focused on the 0x80004005 event and traced it to a problem with the IIS environment. A quick look at the IIS logs and client-side packet capture both showed a 301 (permanently removed) response from the web server. This didn't make much sense as Exchange is configured for a 302 redirect. After ruling out network connectivity issues, network load balancer issues and a few client side configurations, we found some data in the registry at the key HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\AutoDiscover (or 14.0 if you're using Outlook 2010). These values existed on the BPOS client machine but did not exist on mine.</p>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">"PreferLocalXML"=dword:1<br />"ExcludeHttpRedirect"=dword:0<br />"ExcludeHttpsAutodiscoverDomain"=dword:1<br />"ExcludeHttpsRootDomain"=dword:1<br />"ExcludeScpLookup"=dword:1<br />"ExcludeSrvLookup"=dword:1<br />"ExcludeSrvRecord"=dword:1</span></p>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">We set the values to zero and Outlook began behaving normally again. These values are installed and used in a variety of ways by customers of the Exchange Online service. The final resolution/cause appeared to be that the registry settings installed by BPOS prevented Outlook from using the HTTPS AutoDiscover service to get its configuration information.</span></p>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">See also <a href="http://social.technet.microsoft.com/forums/en-US/onlineservicesmigrationandcoexistence/thread/d6c69c69-6524-493b-a0c6-21c79e146ce7/">http://social.technet.microsoft.com/forums/en-US/onlineservicesmigrationandcoexistence/thread/d6c69c69-6524-493b-a0c6-21c79e146ce7/</a></span></p>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3"></span></p>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3"></span></p>]]></content:encoded>
    </item>
    <item>
      <title>A Sandwich You Should Avoid Ordering</title>
      <link>https://docs.microsoft.com/archive/blogs/anthonw/a-sandwich-you-should-avoid-ordering</link>
      <pubDate>Wed, 29 Feb 2012 19:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Anthony Witecki]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anthonw/2012/02/29/a-sandwich-you-should-avoid-ordering/</guid>
      <description><![CDATA[Secure by default is a great&nbsp;response to the security problems that plagued Microsoft nearly a...]]></description>
      <content:encoded><![CDATA[<p>Secure by default is a great&nbsp;response to the security problems that plagued Microsoft nearly a decade ago, but sometimes we, as consumers of a product, confuse the concepts of vulnerability and functionality. The receive connector is an example that I recently revisited, causing me enough confusion with a customer that I felt it might be time to collect and then share my thoughts on what exactly these things are. As described by TechNet, "Receive connectors are configured on computers that are running Microsoft Exchange Server 2010 and that have the Hub Transport server role or Edge Transport server role installed. Receive connectors represent a logical gateway through which all inbound messages are received.[<a title="Link to Understanding Receive Connectors" href="http://technet.microsoft.com/en-us/library/aa996395.aspx">1</a>]" So, how else might we define these in a succinct manner? I would propose, "A receive connector is a logical gateway that assumes responsibility for message delivery or relay, based on whether a sender matches the connector's configured rules."</p>
<p>By default, Exchange 2010 ships with a <em>Default [ServerName]</em> receive connector on every machine with the hub transport role. One of the things that makes Exchange 2010 secure by default is that the default receive connector will not accept anonymous requests, will require at least one form of authentication, and will prefer TLS when possible. While this ensures internal message delivery across the SMTP protocol within your organization, it simultaneously prevents any messages from entering your environment from the Internet (arguably defeating the purpose of email). Email can enter your organization any number of ways, but one of the more common scenarios is through a hosted message security &amp; hygiene service, like Microsoft's Forefront Online Protection for Exchange (FOPE). In this scenario, all email is referred to FOPE though the MX records. It is delivered to and scanned by the Microsoft service and relayed directly to your organization (either through an Edge role, or TMG/UAG-published hub transport role). Most customers (in its simplest, but rarest configuration) simply stand up a second receive connector designed to listen only to the FOPE address lists and allow anonymous authentication. That's what we had in this story, well mostly.</p>
<p>The&nbsp;customer had a TMG Firewall Sandwich that looked something like this:</p>
<p><span style="color: #ff6600;">SMTP--&gt;FOPE</span>--&gt;<span style="color: #ff0000; background-color: #ffffff;">Firewall Public</span>--&gt;<span style="color: #993366;">NAT</span>--&gt;TMG Published SMTP--&gt;<span style="color: #ff0000;">Firewall (same one)&nbsp;Internal</span>--&gt;<span style="color: #99cc00;">Load Balancer SMTP</span>--&gt;<span style="color: #00ccff;">Hub Transport Role Server</span></p>
<p>What made it tricky was the security team's insistence that the internet-facing <span style="color: #993366;">NIC on the TMG server be assigned a private address which was then&nbsp;published via Network Address Translation (NAT)</span> behind&nbsp;the "<span style="color: #ff0000;">real firewall</span>." I won't even begin to discuss why this is a ridiculous design, but it was what we had to work with. So a SMTP Server publishing rule was created on the TMG server and directed to the <span style="color: #99cc00;">Virtual IP (VIP) of the load balancer</span>. The rule was designed to make SMTP traffic appear to come from the original sender (versus a proxy by the TMG server). Initial tests showed that the connection from FOPE was successfully reaching the TMG Server, and being passed through to one of the Hub Transport Servers. However, our TMG logs showed that no SYN/ACK was being received by the FOPE server and the connection was being closed. The log file on the TMG Server looked similar to the following:</p>
<p>&nbsp;A <strong>connection</strong> was <strong>closed</strong> <strong>because</strong> no <strong>SYN/ACK</strong> reply was <strong>received</strong> from the server.</p>
<p>A little research confirmed my suspicions that blamed the firewall sandwich. Because outbound traffic inside the network was not configured to route back through the TMG, but instead directly through the "real firewall," all hopes of communication were lost on different highways. The quick and dirty fix, of course, is to change the configuration of the TMG rule to specify that <strong>Requests appear to come from the TMG Server</strong>. This solved the first problem, but mail still wasn't flowing. This made it necessary to crack open NetMon. Below is a synopsis of what we saw:</p>
<p>SMTP:Rsp 250 -<span style="color: #ff0000;">(REMOVED)</span>CAS01.customer.com Hello [<span style="color: #ff0000;">IP REMOVED</span>], 260 bytes<br />SMTP:Cmd STARTTLS, Server is currently able to negotiate the use of TLS<br />SMTP:Rsp 220&nbsp; 2.0.0 SMTP server ready, 29 bytes<br />SSL:SSLv2RecordLayer, Error (needs reassembly)<br />SSL:SSLv2RecordLayer, Client Finished (needs reassembly)<br />SSL:SSLv2RecordLayer, ClientHello (0x01) (needs reassembly)<br />SSL:SSLv2RecordLayer, Error (needs reassembly)</p>
<p>Basically, the connection was getting established, but any attempts to establish an SSL connection (TLS) were failing and the connection was being closed with a reset (RST) flag on the TMG logs. This is easily blamed on NAT. If TMG is going to negotiate security with FOPE, they need to be able to verify sending addresses, with which NAT interferes. And this is where receive connectors come into play. Our original internet receive connector was expecting everything to come from the TMG server, since it was terminating and replaying connections as part of its proxy duties. So, it was set up to allow port 25 from the IP Addresses assigned to the TMG server with anonymous access and default authentication mechanisms. Once the initial failures started, the thought was to disable TLS (all auth methods, actually) and that should solve our immediate problem. But it didn't.</p>
<p>I could see on the TMG that traffic was flowing to the VIP of the load balancer and SMTP traffic was answering from either of the two HT servers. So I installed NetMon on the HT server and watched both machines at the same time. What I discovered was that the TMG server was sending to the VIP of the load balancer, which was configured for SMTP load distribution. The load balancer was establishing a new session with the hub transport server. So the hub replied to the load balancer which replied to the TMG server. So my receive connector was never even getting used because it was expecting traffic from the TMG server that never arrived. What was happening is that all my traffic was going to the default receive connector that was still trying to use TLS and no anonymous. By now, I was wondering, how do I even know which receive connector I am talking to? There's an att(ribute) for that. Using the following cmdlet, you can establish a specialized banner message on your receive connector that will show up on the SMTP:220 response in either a telnet session or on the NetMon trace. The cmdlet is:</p>
<p><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Arial; mso-bidi-font-family: Arial; mso-ansi-language: EN-AU; mso-fareast-language: JA; mso-bidi-language: AR-SA;" lang="EN-AU">get-ReceiveConnector "[ServerName]\[ConnectorName]" | Set-ReceiveConnector -Banner "220 CAS01Default"</span></p>
<p><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Arial; mso-bidi-font-family: Arial; mso-ansi-language: EN-AU; mso-fareast-language: JA; mso-bidi-language: AR-SA;" lang="EN-AU">Your banner can say anything, but it should identify the server and connector in some way. Once establishing these for my primary receive connectors in question, I turned back on the NetMon trace and validated that, sure enough, all my traffic was by-passing the TMG receive connector in favor of the default, where it just failed. My solution was to adjust the address range of the TMG connector so that it contained the VIP of the hardware load balancer. Immediately, the SMTP traffic started flowing, end-to-end on all machines being monitored. </span></p>
<p><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Arial; mso-bidi-font-family: Arial; mso-ansi-language: EN-AU; mso-fareast-language: JA; mso-bidi-language: AR-SA;" lang="EN-AU">One word of caution. This is not an optimal solution, just because mail is again flowing. FOPE is TLS capable, as is this customer's environment. However, in the name of security, the security team "broke" the standard communication protocols at layers 3 and 4 of the OSI model. This ultimately&nbsp;prevented secure transmissions at layer 7 (TLS in Exchange). So, while mail is once again flowing, it is actually doing it in a less secure manner than if the firewall sandwich had just been abandoned as a security principle. </span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Event 1006 FailoverClustering: Cluster Service was halted due to incomplete connectivity with the other nodes</title>
      <link>https://docs.microsoft.com/archive/blogs/anthonw/event-1006-failoverclustering-cluster-service-was-halted-due-to-incomplete-connectivity-with-the-other-nodes</link>
      <pubDate>Wed, 22 Feb 2012 14:25:01 GMT</pubDate>
      <dc:creator><![CDATA[Anthony Witecki]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anthonw/2012/02/22/event-1006-failoverclustering-cluster-service-was-halted-due-to-incomplete-connectivity-with-the-other-nodes/</guid>
      <description><![CDATA[Ran into this event on an Exchange DAG where the customer was reporting that Exchange seemed to be...]]></description>
      <content:encoded><![CDATA[<p>Ran into this event on an Exchange DAG where the customer was reporting that Exchange seemed to be making arbitrary decisions to randomly failover from Node1 to Node2 of the mailbox cluster. Some investigation showed that the 1006 event always corresponded to a 4082 MSExchangeRepl event in the application log and the events seemed to happen consistently betwee 7:00 PM and 8:00 PM, but not every night and oddly at 15 minute intervals (7:16 one night, 7:31 a different night). </p>
<p>Most of the reseach indicated this was related to a network failure. We checked the hardware, software patches, drivers and everything seemed okay. Other events would also show up around the same time of day:</p>
<p>7024 Service Control Manager: The cluster service terminated with the service-specific error, "The membership engine requested shutdown of the cluster service on this node."</p>
<p>7031 Service Control Manager: "The cluster service terminated unexpectedly. It has done this 1 time(s). Correction action: restart service.</p>
<p>7036 Service Control Manager: The cluster service entered the running state.</p>
<p>&nbsp;</p>
<p>Ultimately, this was traced to a backup utility running on the DAG member.</p>]]></content:encoded>
    </item>
    <item>
      <title>It's always the hardware</title>
      <link>https://docs.microsoft.com/archive/blogs/anthonw/its-always-the-hardware</link>
      <pubDate>Fri, 29 Jul 2011 15:52:00 GMT</pubDate>
      <dc:creator><![CDATA[Anthony Witecki]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anthonw/2011/07/29/its-always-the-hardware/</guid>
      <description><![CDATA[It's always the hardware.&nbsp; If it's not the firewall, it's the network.&nbsp; If it's not the...]]></description>
      <content:encoded><![CDATA[<p>It's always the hardware.&nbsp; If it's not the firewall, it's the network.&nbsp; If it's not the network, it turns out, it might be the CD drive.&nbsp; Strangest situation encountered today.&nbsp; Tyring to install Exchange 2010 SP1 integrated on a new server (virtualized).&nbsp; The CD is linked to the physical CD on the host.&nbsp; When we attempt to run the GUI setup, the scripts on the splash screen fail to load and setup cannot continue (in fact, we cannot even get a graphic to display).&nbsp; We switch to the shell, since that was our plan anyway.&nbsp; Setup.com /role:um /installwindowscomponents fails.&nbsp; But it fails in a weird way.&nbsp; It says, "Copying Setup Files Complete."&nbsp; No errors, no logs, no install.&nbsp;</p>
<p>Instinctly, I blame the hardware.&nbsp; We copy the CD contents (the CD is known good) to a local drive and try running setup from the E: drive.&nbsp; Same thing.&nbsp; At this point, I am at wits' end and the customer suggests taking the CD from the host server, putting it into the laptop's DVD drive (which is remotely connected to the remote desktop session).&nbsp; I'm not crazy about the speed problems we're going to encounter, but I agree, because I need to rule out hardware.</p>
<p>As I started the post so too will I end it.&nbsp; It's always the hardware.</p>]]></content:encoded>
    </item>
    <item>
      <title>How Do I Programmatically Extract Numeric Data From Get-MailboxStatistics?</title>
      <link>https://docs.microsoft.com/archive/blogs/anthonw/how-do-i-programmatically-extract-numeric-data-from-get-mailboxstatistics</link>
      <pubDate>Thu, 28 Jul 2011 09:39:00 GMT</pubDate>
      <dc:creator><![CDATA[Anthony Witecki]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anthonw/2011/07/28/how-do-i-programmatically-extract-numeric-data-from-get-mailboxstatistics/</guid>
      <description><![CDATA[I recently was working with&nbsp;a customer to build a reporting&nbsp;solution for their Exchange...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">I recently was working with&nbsp;a customer to build a reporting&nbsp;solution for their Exchange 2010 environment.&nbsp; The report was going to be used for billing and compliance administration.&nbsp; Basically, the organization needed to know how many mailboxes per customer, what some key settings on those mailboxes were.&nbsp; We had a couple of challenges.&nbsp; The first was tying a user to a specific customer.&nbsp; The company attribute in Active Directory was not reliably used.&nbsp; Some customers could be tied to a domain or oganizational unit while others spanned multiple.&nbsp; To resolve that, we created an input file with three values, the agency code (customer billing code), the agency name (customer name) and the agency's recipient view root.&nbsp; If an agency had more than a single view root, mutiple lines in the text file could be processed as long as the code and agency name was consistent.&nbsp; The first line of the CSV file must contain these headers for the code to work: CID,CustomerName,ViewRoot.</span></p>
<p><span style="font-size: small;">The second issue extracting numerical information from the Get-MailboxStatistics cmdlet for attributes like TotalItemSize.&nbsp; By default, it's reported as "250.1 MB (262,144,128 bytes)."&nbsp; While that looks pretty and is even fairly easy to read, it doesn't aggregate well in an Excel pivot table.&nbsp; It needed to be converted to a numeric value and functions exist to do so.&nbsp; By calling out $object.TotalItemSize.Value.ToBytes() we can get a numer to display in the console, but I found it particularly challenging to assign the value to returned to a variable.&nbsp; After several iterations, including some painfully challenging string breaking and re-concatenation, I came upon the idea to use Select-Object.&nbsp; While it certainly seems like an unnecessary complication, I am pleased to see it works.&nbsp; I am also happy to share it, because I know from my own research that many others are experiencing this same request.&nbsp; </span></p>
<p><span style="color: #339966; font-family: courier new,courier;">## Create a new variable, specified as an array </span><br /><span style="font-family: courier new,courier;">$MailboxData = @()</span></p>
<p><span style="color: #339966; font-family: courier new,courier;">## Create a top-level loop for each customer's scope.&nbsp; Even though we grab the OU below, we need a controlled input file for aligning</span><br /><span style="color: #339966; font-family: courier new,courier;">## discontiguous scopes with specific billing codes.&nbsp; The CID code is considered the billing code for report purposes.</span><br /><span style="font-family: courier new,courier;">ForEach ($Customer IN Import-CSV [Insert Name of Input File]) {</span></p>
<p style="padding-left: 30px;"><span style="color: #339966; font-family: courier new,courier;">&nbsp;## Scope the output using a known scoped parameter from the input file</span><br /><span style="font-family: courier new,courier;">&nbsp;Set-ADServerSettings -RecipientViewRoot $Customer.ViewRoot</span></p>
<p style="padding-left: 30px;"><span style="color: #339966; font-family: courier new,courier;">&nbsp;## Now, loop through all non-legacy mailbox types in the defined scope (2010 mailboxes only in this case)</span><br /><span style="font-family: courier new,courier;">&nbsp;ForEach ($mailbox in Get-Mailbox -ResultSize Unlimited | where{$_.RecipientTypeDetails -notlike "Legacy*"}) {</span></p>
<p style="padding-left: 60px;"><span style="color: #339966; font-family: courier new,courier;">&nbsp; ## Create a new database object to populate with several columns, listed below</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject = new-object PSObject</span></p>
<p style="padding-left: 60px;"><span style="color: #339966; font-family: courier new,courier;">&nbsp; ## Columns are grouped by source.</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp; ## The first group is all from the Agency Variable created by the top-level loop</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name CID -Value $Customer.CID</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name CustomerName -Value $Customer.CustomerName</span></p>
<p style="padding-left: 60px;"><span style="color: #339966; font-family: courier new,courier;">&nbsp; ## This group is extracted from the Get-Mailbox object data</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name Alias -Value $Mailbox.alias </span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name EmailAddress -Value $Mailbox.primarysmtpaddress</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name OU -Value $Mailbox.organizationalunit</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name DisplayName -Value $Mailbox.DisplayName</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name Database -Value $Mailbox.Database</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name EmailAddressPolicyEnabled -Value $Mailbox.EmailAddressPolicyEnabled </span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name SingleItemRecoveryEnabled -Value $Mailbox.SingleItemRecoveryEnabled</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name LitigationHoldEnabled -Value $Mailbox.LitigationHoldEnabled</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name RetentionComment -Value $Mailbox.RetentionComment</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name StartDateForRetentionHold -Value $Mailbox.StartDateForRetentionHold</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name EndDateForRetentionHold -Value $Mailbox.EndDateForRetentionHold</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name LitigationHoldDate -Value $Mailbox.LitigationHoldDate</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name LitigationHoldOwner -Value $Mailbox.LitigationHoldOwner</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name IsMailboxEnabled -Value $Mailbox.IsMailboxEnabled</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name ModerationEnabled -Value $Mailbox.ModerationEnabled</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name ThrottlingPolicy -Value $Mailbox.ThrottlingPolicy</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name UseDatabaseQuotaDefaults -Value $Mailbox.UseDatabaseQuotaDefaults</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name ProhibitSendReceiveQuota -Value $Mailbox.ProhibitSendReceiveQuota</span></p>
<p style="padding-left: 60px;"><span style="color: #339966; font-family: courier new,courier;">&nbsp; ## Create an object variable to store the get-mailboxstatistics object with select attributes that we can customize (as expressions) to make them</span><br /><span style="color: #339966; font-family: courier new,courier;">&nbsp; ## friendly to an Excel or other computational environment.&nbsp; If you will be adding attributes to this section, you need to add them both to the Select-Object cmdlet and the Add-Member.</span><br /><span style="font-family: courier new,courier;">&nbsp; $MbxS = Get-mailbox $mailbox.alias | Get-MailboxStatistics | Select-Object LastLoggedOnUserAccount,LastLogonTime,totalDeleteditemsize,itemcount,storagelimitstatus,@{Expression={$_.totalitemsize.value.ToBytes()};Label="TotalMBSize"},@{Expression={$_.totalDeleteditemsize.value.ToBytes()};Label="TotalDeletedItemSize"}</span><br /><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name StorageLimitStatus -Value $MBxS.StorageLimitStatus</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name Items -Value $MBxS.ItemCount</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name TotalItemSize -Value $MBxS.TotalMBSize</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name DeletedItemSize -Value $MBxS.TotalDeletedItemSize</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name LastLogonTime -Value $MBxS.LastLogonTime</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name LastLoggonOnUser -Value $MBxS.LastLoggedOnUserAccount</span><br />&nbsp; <br /><span style="color: #339966; font-family: courier new,courier;">&nbsp; ## This group is from the Get-User object</span><br /><span style="font-family: courier new,courier;">&nbsp; $U = Get-User $mailbox.alias</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name Company -Value $U.Company</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name FirstName -Value $U.FirstName</span><br /><span style="font-family: courier new,courier;">&nbsp; $DBObject | add-member NoteProperty -Name LastName -Value $U.LastName</span><br />&nbsp; <br /><span style="color: #339966; font-family: courier new,courier;">&nbsp; ## Append the row to the top-level variable used to store the array</span><br /><span style="font-family: courier new,courier;">&nbsp; $MailboxData += $DBObject&nbsp;</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">&nbsp;}</span></p>
<p style="padding-left: 30px;"><span style="color: #339966; font-family: courier new,courier;">## Now, let's loop around and get the next agency in the CSV input file</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p><span style="color: #339966; font-family: courier new,courier;">## Export the array to CSV file using the user supplied value (or default if none supplied)</span><br /><span style="font-family: courier new,courier;">$MailboxData | Export-Csv $o -NoTypeInformation</span></p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Beyond RBAC: Delegating the 'Mail-enable Public Folders' right</title>
      <link>https://docs.microsoft.com/archive/blogs/anthonw/beyond-rbac-delegating-the-mail-enable-public-folders-right</link>
      <pubDate>Fri, 21 Jan 2011 11:31:00 GMT</pubDate>
      <dc:creator><![CDATA[Anthony Witecki]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anthonw/2011/01/21/beyond-rbac-delegating-the-mail-enable-public-folders-right/</guid>
      <description><![CDATA[In the RBAC world, it should be possible to create a new management role, based on the built-in role...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;"><span style="font-family: tahoma,arial,helvetica,sans-serif;">In the RBAC world, it should be possible to create a new management role, based on the built-in role "Mail-enable public folders."&nbsp; The built-in role allows delegates/members to run the enable-mailpublicfolder cmdlet.&nbsp; When you add users to the built-in role, they can execute assigned duties without incident.&nbsp; However, when you create a new management role, or attempt to add the built-in role to a non-built-in role assignement, the cmdlet fails.&nbsp; It fails with the following access denied error.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: tahoma,arial,helvetica,sans-serif;">
<p class="MsoNormal"><span style="font-family: courier new,courier;"><span style="font-size: x-small;"><strong><span style="color: #ff0000;">MapiExceptionNoAccess: Unable to set properties on object. (hr=0x80070005, ec=-2147024891)</span></strong></span></span></p>
</span></span></p>
<p>You may also see several lines of diagnostic context.&nbsp; It is my opinion that this is caused by a failure of the RBAC delegation model to adequately apply the necessary permissions in Active Directory to make the delegation work.&nbsp; As evidence, I submit the following cmdlets that seem to validate a certain suite of permissions are necessary and granted to the built-in group "Public Folder Management."&nbsp; We can look at the permissions on the store:</p>
<p><span style="font-size: small;"><span style="font-family: tahoma,arial,helvetica,sans-serif;"><span style="font-size: x-small;">&nbsp;</span></span></span></p>
<p><span style="font-family: courier new,courier;"><span style="font-size: x-small;">Get-PublicFolderAdministrativePermission "\" | where {$_.user -like 'root\public folder management'} | select accessrights</span></span></p>
<p><span style="font-family: courier new,courier;"><span style="font-size: x-small;">AccessRights<br />------------<br /><strong><span style="color: #993300;">{ViewInformationStore}</span></strong><br />{AdministerInformationStore}<br />{ModifyPublicFolderACL}<br /><span style="color: #993300;"><strong>{MailEnablePublicFolder}</strong></span><br />{ModifyPublicFolderQuotas}<br />{ModifyPublicFolderAdminACL}<br />{ModifyPublicFolderExpiry}<br />{ModifyPublicFolderReplicaList}<br />{ModifyPublicFolderDeletedItemRetention}<br /></span></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif;"><span style="font-size: small;">and the complementary permissions in Active Directory appear to correspond.</span></span></p>
<p><span style="font-family: courier new,courier;"><span style="font-size: x-small;">Get-ADPermission -Identity "CN=ORG,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=root,DC=gov" | ?{$_.user -like "root\public folder management"}</span></span></p>
<p><span style="font-family: courier new,courier;"><span style="font-size: x-small;">AccessRights&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExtendedRights<br />-------------- &nbsp;&nbsp;&nbsp;--------------<br /><strong><span style="color: #993300;">{GenericRead}</span></strong><br />{ExtendedRight}&nbsp;&nbsp; {ms-Exch-Store-Create-Named-Properties}<br />{ExtendedRight}&nbsp; &nbsp;{ms-Exch-Store-Admin}<br />{ExtendedRight}&nbsp;&nbsp; {ms-Exch-Store-Visible}<br />{ExtendedRight}&nbsp;&nbsp; {ms-Exch-Create-Top-Level-Public-Folder}<br />{ExtendedRight}&nbsp;&nbsp; {ms-Exch-Modify-Public-Folder-Deleted-Item-Retention}<br />{ExtendedRight}&nbsp;&nbsp; {ms-Exch-Modify-Public-Folder-Replica-List}<br />{ExtendedRight}&nbsp;&nbsp; {ms-Exch-Modify-Public-Folder-Expiry}<br />{ExtendedRight}&nbsp;&nbsp; {ms-Exch-Modify-Public-Folder-Quotas}<br />{ExtendedRight}&nbsp;&nbsp; {ms-Exch-Modify-PF-ACL}<br />{ExtendedRight}&nbsp;&nbsp; {ms-Exch-Create-Public-Folder}<br /></span><span style="font-size: x-small;"><strong><span style="color: #993300;">{ExtendedRight}&nbsp;&nbsp; {ms-Exch-Mail-Enabled-Public-Folder}<br /></span></strong>{ExtendedRight}&nbsp;&nbsp; {ms-Exch-Modify-PF-Admin-ACL}</span></span></p>
<p><span style="font-size: small;"><span style="font-family: tahoma,arial,helvetica,sans-serif;">To test my theory, I granted the same permissions (highlighted above in red) to my&nbsp;newly created delegate group using the following cmdlets.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: tahoma,arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="font-family: courier new,courier;">Add-ADPermission "CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=root,DC=com" -user "root\Delegated Messaging Admins" -AccessRights GenericRead<br />&nbsp;<br />Add-ADPermission "CN=OrgName,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=root,DC=com" -user "root\Delegated Messaging Admins" -ExtendedRights ms-Exch-Mail-Enabled-Public-Folder</span></span></span></span></p>
<p><span style="font-size: small;"><span style="font-family: tahoma,arial,helvetica,sans-serif;">Logging off and back on, the delegation took and appears to be consistently working.&nbsp; I have been unable to get a confirmed answer on whether this practice is supported but given the ease with which it's implemented, and the consistency with which it works, I am okay with taking the risk that it may require additional modifications in future versions or service packs.&nbsp; </span></span></p>
<p><span style="font-size: small;"><span style="font-family: tahoma,arial,helvetica,sans-serif;">This document is based on Exchange 2010 SP1.<br /></span></span>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</p>]]></content:encoded>
    </item>
    <item>
      <title>Complex oPath Queries and the New-EmailAddressPolicy Cmdlet</title>
      <link>https://docs.microsoft.com/archive/blogs/anthonw/complex-opath-queries-and-the-new-emailaddresspolicy-cmdlet</link>
      <pubDate>Tue, 18 Jan 2011 11:54:35 GMT</pubDate>
      <dc:creator><![CDATA[Anthony Witecki]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anthonw/2011/01/18/complex-opath-queries-and-the-new-emailaddresspolicy-cmdlet/</guid>
      <description><![CDATA[I've been working an interesting challenge this week in attempt to convert email address policies...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Calibri;">I've been working an interesting challenge this week in attempt to convert email address policies from Exchange 2003 to Exchange 2010.<span style="mso-spacerun: yes;">&nbsp; </span>As part of the conversion process, LDAP queries that define the recipient filter (to which the policy will apply) need to be converted to oPath queries.<span style="mso-spacerun: yes;">&nbsp; </span>In most environments, these queries are pretty simple. <span style="mso-spacerun: yes;">&nbsp;</span>One policy applies to everyone.<span style="mso-spacerun: yes;">&nbsp; </span>In this organization, however, each department has its own email suffix.<span style="mso-spacerun: yes;">&nbsp; </span>In Exchange 2003, this was easy.<span style="mso-spacerun: yes;">&nbsp; </span>Each department had its own administrative group and therefore its own legacyExchangeDN.<span style="mso-spacerun: yes;">&nbsp; </span><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Calibri;">With the move to Exchange 2010, all departments were being consolidated.<span style="mso-spacerun: yes;">&nbsp; </span>While this won't impact migrated users, it will create issues for newly created users, groups, etc.<span style="mso-spacerun: yes;">&nbsp; </span>The business requirements were laid out as follows: <o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">All users will be assigned a three letter department/agency code that will be written to the company attribute on the user object.<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">All mail-enabled groups must be named according to the following naming convention:<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 1in; mso-add-space: auto; mso-list: l0 level2 lfo1;"><span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">a.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">&lt;Agency Code&gt; + "DL" + [User determined name]<span style="mso-spacerun: yes;">&nbsp; </span>-or-<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 1in; mso-add-space: auto; mso-list: l0 level2 lfo1;"><span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">b.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">&lt;Group Scope&gt; + "-" + &lt;Group Type&gt; + "-" + &lt;Agency Code&gt; + [User determined name]<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">All mail enabled public folders must end with "(&lt;AGY&gt;)" where &lt;AGY&gt; is the three-letter agency code for each department.<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">The primary email address for all users is firstname.lastname@agy.company.com and must be all lower case without apostrophes.<span style="mso-spacerun: yes;">&nbsp; </span>Secondary email address is username@agy.comany.com.<o:p></o:p></span></span></p>
<p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;">Existing user mailboxes will keep their existing email addresses, as some users are grandfathered in, even though they don't explicitly match the state requirement.<span style="mso-spacerun: yes;">&nbsp; </span>The email address policy is only to be applied to new users.<o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Calibri;">The first step involves differentiating the 2003 users to be migrated from new users that will be created new in 2010.<span style="mso-spacerun: yes;">&nbsp; </span>New users will all be covered by the new policy.<span style="mso-spacerun: yes;">&nbsp; </span>Existing mailboxes might still benefit from the policy, but must be individually evaluated to prevent mistaken overwrites.<span style="mso-spacerun: yes;">&nbsp; </span>Prior to migration, the EmailAddressPolicyEnabled property is set to false on all existing mailboxes.<span style="mso-spacerun: yes;">&nbsp; </span><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Calibri;">The second step was writing an oPath query that met the business requirements above.<span style="mso-spacerun: yes;">&nbsp; </span>This was ultimately written as follows:<o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-spacerun: yes;">&nbsp;</span>(<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>(<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>RecipientType -EQ 'UserMailbox' -OR<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>RecipientType -EQ 'MailUser' -OR<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>RecipientType -EQ 'linkedMailbox' -OR<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>RecipientType -EQ 'SharedMailbox' -OR<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>RecipientType -EQ 'RoomMailbox' -OR<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>RecipientType -EQ 'EquipmentMailbox' <o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>) <o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>-AND&nbsp;&nbsp; <o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>(<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>company -like 'AGY*'<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>)<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;">) <o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;">-OR <o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;">(<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>(<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>RecipientType -EQ 'MailUniversalDistributionGroup' -OR<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>RecipientType -EQ 'MailNonUniversalGroup' -OR<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>RecipientType -EQ 'MailUniversalSecurityGroup' -OR<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>RecipientType -EQ 'DynamicDistributionGroup'<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>) <o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>-AND <o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>(<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>DisplayName -like 'AGY DL*' -OR <o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>DisplayName -like 'U-S-AGY*'<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>)<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;">)<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;">-OR<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;">(<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>RecipientType -EQ 'PublicFolder'<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>-AND<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="mso-tab-count: 1;">&nbsp; </span>DisplayName -like '*(AGY)'<o:p></o:p></span></span></span></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;">)<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Calibri;">The oPath query must be collapsed for PowerShell consumption.<span style="mso-spacerun: yes;">&nbsp; </span>However, I noticed a few problems during that process.<span style="mso-spacerun: yes;">&nbsp; </span>The PowerShell cmdlet didn't like references to linked, shared, room or equipment mailboxes.<span style="mso-spacerun: yes;">&nbsp; </span>So, those parts of the oPath query were removed from the recipient filter attribute of the New-EmailAddressPolicy cmdlet.<span style="mso-spacerun: yes;">&nbsp; </span><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-family: Calibri; font-size: small;">The second challenge when creating the new policy cmdlets was forcing the capital letters that might exist in someone's first or last name attributes to lowercase as well as removing the apostrophe.<span style="mso-spacerun: yes;">&nbsp; </span>This can actually be done with some of the same type of regular expressions as defined at </span><a href="http://technet.microsoft.com/en-us/library/bb232171.aspx"><span style="font-family: Calibri; font-size: small;">http://technet.microsoft.com/en-us/library/bb232171.aspx</span></a><span style="font-size: small;"><span style="font-family: Calibri;">.<span style="mso-spacerun: yes;">&nbsp; </span>Granted, it's a little more complicated, but mostly just hard to read.<o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #f2f2f2;"><span style="color: #0000ff;"><span style="background-color: #ffffff;"><span style="font-family: courier new,courier;">SMTP:%rAa%rBb%rCc%rDd%rEe%rFf%rGg%rHh%rIi%rJj%rKk%rLl%rMm%rNn%rOo%rPp%rQq%rRr%rSs%rTt%rUu%rVv%rWw%rXx%rYy%rZz%g.%rAa%rBb%rCc%rDd%rEe%rFf%rGg%rHh%rIi%rJj%rKk%rLl%rMm%rNn%rOo%rPp%rQq%rRr%rSs%rTt%rUu%rVv%rWw%rXx%rYy%rZz%r''%s@agy.company.com<o:p></o:p></span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Calibri;">Coupled with our now collapsed oPath query, we have the powershell cmdlet that builds our new policies.<o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>
<p class="Code" style="margin: 0in 0.1in 0pt;"><span style="background-color: #f2f2f2;"><span style="color: #0000ff;"><span style="font-family: courier new,courier;"><span style="background-color: #ffffff;">New-EmailAddressPolicy -name "AGY Users" -EnabledEmailAddressTemplates "SMTP:%rAa%rBb%rCc%rDd%rEe%rFf%rGg%rHh%rIi%rJj%rKk%rLl%rMm%rNn%rOo%rPp%rQq%rRr%rSs%rTt%rUu%rVv%rWw%rXx%rYy%rZz%g.%rAa%rBb%rCc%rDd%rEe%rFf%rGg%rHh%rIi%rJj%rKk%rLl%rMm%rNn%rOo%rPp%rQq%rRr%rSs%rTt%rUu%rVv%rWw%rXx%rYy%rZz%r''%s@agy.company.com","smtp:%m@agy.company.com","X400:c=US;a= ;p=Company;o=Exchange;" -RecipientFilter {((RecipientType -EQ 'UserMailbox' -OR RecipientType -EQ 'MailUser') -AND (company -like 'AGY*')) -OR ((RecipientType -EQ 'MailUniversalDistributionGroup' -OR RecipientType -EQ 'MailNonUniversalGroup' -OR RecipientType -EQ 'MailUniversalSecurityGroup' -OR RecipientType -EQ 'DynamicDistributionGroup') -AND (DisplayName -like 'AGY DL*' -OR DisplayName -like 'U-S-AGY*')) -OR (RecipientType -EQ 'PublicFolder' -AND DisplayName -like '*(AGY)')}<o:p></o:p></span></span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><o:p><span style="color: #0000ff;"><span style="font-family: courier new,courier;"><span style="background-color: #ffffff;">&nbsp;</span></span></span></o:p></p>]]></content:encoded>
    </item>
    <item>
      <title>Why bartenders may soon love Excel as much as accountants</title>
      <link>https://docs.microsoft.com/archive/blogs/anthonw/why-bartenders-may-soon-love-excel-as-much-as-accountants</link>
      <pubDate>Mon, 17 Jan 2011 21:28:00 GMT</pubDate>
      <dc:creator><![CDATA[Anthony Witecki]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anthonw/2011/01/17/why-bartenders-may-soon-love-excel-as-much-as-accountants/</guid>
      <description><![CDATA[UPDATE (3/28/11): I've been thinking about this post for awhile, unable to believe that someone else...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: medium;"><strong><span style="background-color: #ffffff;"><span style="color: #ff0000;"><span style="font-size: small;">UPDATE (3/28/11): I've been thinking about this post for awhile, unable to believe that someone else hadn't already thought of the obvious.&nbsp; Did a little research this morning and realized all my work was in vein (but I am happy about it).&nbsp; Excel does have an =CONVERT(number,from_unit,to_unit) function built in and is much easier than trying to manage the macros necessary to build your own solution.&nbsp; Just about every possible unit series(distance, length, weight, volume) is included and the friendly drop-downs even guide you through it.</span></span></span></strong></span></p>
<p><span style="font-size: medium;">Excel has been a favorite among accountants pretty much since it was released.&nbsp; Very few Microsoft products are loved by their users the way Excel is loved by the accounting community.&nbsp; Most of our institutions are held together by monster spreadsheets with ridiculously complex formulas that only one or two people can actually decipher.&nbsp; And that's okay.&nbsp; Excel is a good product, but I recently found myself wanting for more.</span></p>
<p><span style="font-size: medium;"><span style="font-size: medium;">This post, quite different from most, is not targeted at the people who keep mail and directory systems operating every day.&nbsp; This post is targeted at bartenders seeking help with reducing or expanding their recipes for barrel aging, rebottling, whatever the current trend happens to be.&nbsp; </span></span></p>
<p><span style="font-size: medium;"><span style="font-size: medium;"></span>One of my hobbies is the study of cocktails: their history, chemistry, creation, distillation, etc.&nbsp; Recently, I've been in the habit of pre-bottling some of my favorite cocktails, which involves mixing large batches.&nbsp; Of course, most cocktail recipes call for an ounce here or a dash there, but present quite the challenge when combining 750ml bottles of this and that.&nbsp; Reductions were even more challenging.&nbsp; How do I reduce another bartender's recipe, measured in metric bottles of x and quarts of y, such that it fits into a single 375ml&nbsp;bottle for testing and tasting.&nbsp; So, I turned to Excel to help me with the math.&nbsp; </span></p>
<p><span style="font-size: medium;">To facilitate all the conversions, I created a series of functions in Excel.&nbsp; These functions are snippets of code that work just like Excel's built-in functions.&nbsp; So, let's say you have a recipe that calls for a dash of bitters.&nbsp; You want to make 50 of these cocktails ahead of time.&nbsp; How much should you pour into the mixer?&nbsp; The formula in Excel would be written as follows:</span></p>
<p><span style="font-size: medium;">=ConvDash2Tsp(50)</span></p>
<p><span style="font-size: medium;">And the cell will display 6.25.&nbsp; And, just like standard Excel formulas, these functions can be compounded.&nbsp; So, if you want to see dashes translated to milliliters, you change the cell to:</span></p>
<p><span style="font-size: medium;">=ConvTsp2Ml(ConvDash2Tsp(50))</span></p>
<p><span style="font-size: medium;">where the inner formula's result is passed to the outer formula.&nbsp; The result of the second formula tells us that 50 dashes equals 30.81 milliliters.&nbsp; </span></p>
<p><span style="font-size: medium;">I</span><span style="font-size: medium;">t's unfortunate that for all the formulas offered by Excel, basic conversion between US and metric units were never considered.&nbsp; I've&nbsp;put together a list of a few of them, mostly pertaining to volume, but you can&nbsp;certainly use these as you see fit and create some of your own using the basic template.&nbsp; </span></p>
<p><span style="font-size: medium;">The following code can be pasted into a new Macro window in Excel to take advantage of some of these conversion formulas.</span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvOz2L(oz)<br />'Converts US fluid ounces to liters<br />ConvOz2L = oz / 33.8140226<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvL2Oz(L)<br />'Converts Metric Liters to US Ounces<br />ConvL2Oz = L * 33.8140226<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvOz2ml(oz)<br />'Converts US Ounces to Milliliters<br />ConvOz2ml = oz / 0.0338140226<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvTsp2Oz(tsp)<br />'Converts teaspoons to ounces<br />ConvTsp2Oz = tsp / 6<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvTblsp2Oz(tblsp)<br />'Converts tablespoons to ounces<br />ConvTblsp2Oz = tblsp / 2<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvDash2Tsp(dash)<br />'Converts dashes into teaspoons assumes 8 dashes in a teaspoon<br />ConvDash2Tsp = dash / 8<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvTsp2ml(tsp)<br />'Converts teaspoons to milliliters<br />ConvTsp2ml = tsp * 4.9289216<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvMl2Tsp(ml)<br />'Converts milliliters to teaspoons<br />ConvMl2Tsp = ml / 4.9289216<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvCups2ml(cups)<br />'Converts US cups to milliliters<br />ConvCups2ml = cups * 236.58824<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvMl2cups(ml)<br />'Converts milliliters to US cups<br />ConvMl2cups = ml / 236.58824<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvQuarts2L(quarts)<br />'Converts quarts to liters<br />ConvQuarts2L = quarts * 0.94635295<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvL2Quarts(L)<br />'Converts liters to quarts<br />ConvL2Quarts = L / 0.94635295<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvL2Gal(L)<br />'Converts liters to gallons<br />ConvL2Gal = L * 0.26417205<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvGal2L(gal)<br />'Converts gallons to liters<br />ConvGal2L = gal / 0.26417205<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvL2Cup(L)<br />'Converts liters to cups<br />ConvL2Cup = L * 4.2267528<br />End Function</span></span></p>
<p><span style="font-size: medium;"><span style="font-family: courier new,courier;">Function ConvCup2L(cup)<br />ConvCup2L = cup / 4.2267528<br />End Function<br /></span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Viewing Deleted Active Directory Objects Using LDP</title>
      <link>https://docs.microsoft.com/archive/blogs/anthonw/viewing-deleted-active-directory-objects-using-ldp</link>
      <pubDate>Wed, 05 Jan 2011 11:57:28 GMT</pubDate>
      <dc:creator><![CDATA[Anthony Witecki]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anthonw/2011/01/05/viewing-deleted-active-directory-objects-using-ldp/</guid>
      <description><![CDATA[I am sure this information exists elsewhere, but it falls into that category of something I do just...]]></description>
      <content:encoded><![CDATA[<p>I am sure this information exists elsewhere, but it falls into that category of something I do just often enough to forget how to do it.&nbsp; So, if you find yourself needing to see which objects have been recently deleted from a domain, you can follow these steps to do it.</p>
<ol>
<li>Open LDP</li>
<li>Select <strong>Controls</strong> from the <strong>Options</strong> menu</li>
<li>Under <strong>Load Predefinied</strong> dropdown, select <em>Return Deleted Objects</em>.</li>
<li>Choose the <strong>Check Out</strong> buton to load Obj Identifier <em>1.2.840.113556.1.4.417</em></li>
<li>Choose <strong>Check In</strong> without modification</li>
<li>Click <strong>Ok</strong></li>
<li>From the <strong>View</strong> menu, choose <strong>Tree</strong></li>
<li>Enter <em>cn=deleted objects,dc=domain,dc=com</em> into the <strong>BaseDN</strong> combo box</li>
<li>Browse away at all objects that have been deleted.</li>
</ol>]]></content:encoded>
    </item>
  </channel>
</rss>