Monthly Archives: January 2018

PowerShell script to automatically heal non-deliverable emails (NDRs) as X500

One of the possible causes for a non-delivery report (NDR) is when a mail object in Exchange is moved or removed (Contact, Mailbox, MailUser, etc). When an object is moved, any internal user who had previously emailed that object will have a cached entry in their autocomplete cache that no longer matches up to what now exists. This happens because the autocomplete cache stores the value of the LegacyExchangeDN attribute of the original object before it is moved. When an object is moved, a new LegacyExchangeDN is created.

When sending a message, Outlook will check the Global Address List (GAL), and if it can’t find a match in the GAL, IMCEA encapsulation is used (Internet Mail Connector Encapsulated Addressing). An IMCEA encapsulated address looks like:

IMCEAEX-_O=CONTOSO_OU=First+20Administrative+20Group_cn=Recipients_cn=JDOE@contoso.com

So when an email is sent to the original cached object, an NDR will be sent back to the user containing a construct of the LegacyExchangeDN that it failed to reach, in a slightly different format:

A trailing “EX” at the end of IMCEAEX indicates that a non-SMTP address was encapsulated.

While a quick fix is to have the sender clear their autocomplete cache and re-send the message, a more automated solution is desirable when there are hundreds of potential senders who cached the old object.

I discovered a nifty PowerShell script (here) written by Michael England on 2/11/2013 that searches the Message Tracking Logs for NDRs, and then reconstructs the LegacyExchangeDN from the IMCEA format and adds that as an X500 proxy alias on the target recipient object (if it can be found). This works great in a scenario where the contact object was replaced by a Mailbox or MailUser object.

One of the things I appreciate about how he wrote this script is that when you run the script it reports what would be modified, then when you are ready to modify you just add the -Autoheal parameter to the end of the script. This way you can get an idea of what would be modified before it happens.

I had to modify Michael’s script because Microsoft changed the behavior of the LegacyExchangeDN value in Exchange 2010 SP1 Rollup 6 (released 10/27/2011) to add 3 random hex characters for uniqueness at the end of the LegacyExchangeDN. So when I attempted to use Michael’s script, it was not finding the destination object to add the X500 to it because the 3 random characters threw the search off. So I have posted a very minor change to an otherwise awesome script to strip the 3 characters when searching for the object to place the proxy alias on.

            Write-Host “looking for: ” $user.Substring(0,$user.Length-3)

            $user = $user.Substring(0,$user.Length-3)

 

I also made three separate copies, depending on the recipient object type (Mailbox, MailContact or MailUser).

You can download my slightly modified version of Michael’s script from the Microsoft Technet Gallery here.

https://gallery.technet.microsoft.com/Search-Message-Tracking-6be6d1b7

I left all original credit to Michael in the script, since I only slightly changed the code to strip the 3 random hex characters out, and made separate copies of the script to search for MailUser and MailContact since his script only searched for Mailboxes. I was stoked to discover this awesome script by Michael.

Also shout out to a different Michael, Michael de Rooij for an excellent blog article on this topic here: https://eightwone.com/2013/08/12/legacyexchangedn-attribute-myth/

Change Skype Audio Conferencing Number in Bulk using PowerShell

A client recently asked me if it was possible to change their default Skype Audio Conferencing phone number, because the one they had been assigned was in a different city than where their headquarters was. While it is possible to do a bulk change in the graphical user interface, doing it in PowerShell was better because we could target the change to only users using the old number. Here is the one-liner powershell syntax that we used:

get-CsOnlineDialInConferencingUser | Where-Object {$_.servicenumber -eq (old number)} | %{Set-CsOnlineDialInConferencingUser -identity $_.sipaddress.substring(4) -ServiceNumber (new number)} 

To change it for an individual user:

individual user: Set-CsOnlineDialInConferencingUser -Identity (username) -ServiceNumber (new phone number)

 

Notes: Does not require meeting update service to run! old invites still work fine!

“Alt Coins” have passed Bitcoin for total market cap in Q2 2018

In the last month (12/8 to 1/3), the Bitcoin market cap has declined from it’s peak of 67% to 37%, while alternative coins such as Ripple have grown from 2% to 14% total market share.

What’s also interesting, is while the top 10 alternate currencies have gained substantially, the bigger story in my opinion is the smaller “startup” alt-coins, also known as the ICO market – “Initial Coin Offering.” There are now more than 1,300 alt-coins listed on coinmarketcap.com, and they have gained from 10% in the last 30 days, capturing almost 20% of the total market cap!  (see the “Others” white line in the graphic above). New coins are added each week.

Here is an article from CNBC that explains how to invest in Alt-coins such as Ripple. (click here).

Note: If you are going to invest in alt-coins, use the mainstream exchanges such as Binance, Gdax and Bittrex (when they start accepting new users) because there are many ‘fly by night’ exchanges out there that can only be accessed through TOR. It’s tempting since these exchanges are listing the biggest gainers right now (1,000% increase in profit over 7 days according to coinmarketcap.com). Many of these exchanges don’t accept currency directly so you’ll have to start off with a site such as Coinbase, and then transfer the funds from there into other exchanges. Another reason to use mainstream exchanges is they offer Tax reports.  Otherwise you would have to manually record your gains and losses, which is labor intensive to track since you would have to record the value of the digital currency at the time of the trade. So by using mainstream exchanges, you can benefit from their tax reporting features. Check your exchange (your mileage will vary).

So is too late to invest in cryptocurrencies and other blockchain technology companies?
“The short answer is no, as long as you don’t think the crypto bubble will burst in the near future. However given the trends of the past 48 hours, it’s necessary to invest with great caution. If you’re looking to make a quick million by jumping on the cryptocurrency bandwagon right now, understand that you’re playing with fire. Nevertheless, even with the dip in value of cryptocurrencies in the past two days, there are plenty of undervalued cryptocurrencies that are designed with newly-developed advancements in blockchain technology. If you do invest, it’s worth spending the time to understand the technology and who is developing it – just like investing in a tech stock.”
Reference: https://www.rollingstone.com/culture/features/bitcoin-and-cryptocurrency-what-you-need-to-know-w514552

As a side note, I do think that the Cryptocurrency market is a bubble driven by wild speculation, that will eventually crash. So the best advice is to not invest any money into it that you cannot afford to lose.