<?xml version="1.0" encoding="utf-8"?>
<!-- generator="Joomla! - Open Source Content Management" -->
<feed xmlns="http://www.w3.org/2005/Atom"  xml:lang="en-gb">
	<title type="text">Microsoft Stuff</title>
	<subtitle type="text">Random bits of knowledge gathered over the years. Mostly IT related, but recipes etc will do, too.</subtitle>
	<link rel="alternate" type="text/html" href="https://dynamic.bubbakraut.com"/>
	<id>https://dynamic.bubbakraut.com/msstuff/10-exchange</id>
	<updated>2021-01-14T10:20:19+01:00</updated>
	<author>
		<name>BubbaKraut.com</name>
		<email>admin@bubbakraut.com</email>
	</author>
	<generator uri="https://www.joomla.org">Joomla! - Open Source Content Management</generator>
	<link rel="self" type="application/atom+xml" href="https://dynamic.bubbakraut.com/msstuff/10-exchange?format=feed&amp;type=atom"/>
	<entry>
		<title>Cleaning up unused domains from Exchange users</title>
		<link rel="alternate" type="text/html" href="https://dynamic.bubbakraut.com/msstuff/10-exchange/42-cleaning-up-unused-domains-from-exchange-users"/>
		<published>2015-03-05T12:03:58+01:00</published>
		<updated>2015-03-05T12:03:58+01:00</updated>
		<id>https://dynamic.bubbakraut.com/msstuff/10-exchange/42-cleaning-up-unused-domains-from-exchange-users</id>
		<author>
			<name>Sven Jambor</name>
			<email>admin@bubbakraut.com</email>
		</author>
		<summary type="html">&lt;p&gt;One of the challenges I had recently when migrating users from Exchange 2007 to Exchange Online (who had been migrated over from Lotus Notes before that) was that they had loads (and loads!) of proxyAddress entries. Every domain the company we integrated had ever owned was stuck onto those mailboxes - but we'd decided to only use a handful in Exchange Online.&lt;/p&gt;
&lt;p&gt;When migrating the mailbox from on premise to Exchange Online, the migration failed with the message that the domains on the mailbox were not part of the list of Accepted Domains configured for Exchange Online. Obvously, we could do 2 things: Add all the domains to the Accepted Domains - or clean up the mailboxes. While it did seem like a daunting task, I opted for the latter.&lt;/p&gt;
&lt;hr class=&quot;system-pagebreak&quot; /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In retrospect, it didn't turn out to be much work: I just wrote a Powershell script that does it for me. If you want to use it, just copy/paste the script below to a text file on your Exchange server, adjust the domain names and the mailbox database in which you want to search for mailboxes, save it with a PS1 extension and run it (NB: it will NOT run on Exchange 2013 without some tweaking as I needed it for Exchange 2007)&lt;/p&gt;
&lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt;$MSOnline = &quot;domain1,com,domain2.net,domain3.org&quot;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;font-size: 12.1599998474121px; line-height: 1.3em; font-family: 'courier new', courier;&quot;&gt;Get-MailboxDatabase -Identity &quot;&amp;lt;YOUR MAILBOX DB&amp;gt;&quot; | Get-Mailbox | foreach {&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; #write-output $_.EmailAddresses.count&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt;for ($i=0;$i -lt $_.EmailAddresses.Count; $i++)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; $address = $_.EmailAddresses[$i]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; $domain = $address.AddressString.toString().Split(&quot;@&quot;)[1]&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt;if (!$MSOnline.Contains($domain) -AND $address.PrefixString -eq &quot;SMTP&quot; ) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; write-host &quot;removing $address&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; $_.EmailAddresses.RemoveAt($i)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; $i = $i – 1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; Set-Mailbox -Instance $_&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; #write-output $_.EmailAddresses.count&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; #Write-output &quot;remaining: &quot; $_.EmailAddresses&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt;</summary>
		<content type="html">&lt;p&gt;One of the challenges I had recently when migrating users from Exchange 2007 to Exchange Online (who had been migrated over from Lotus Notes before that) was that they had loads (and loads!) of proxyAddress entries. Every domain the company we integrated had ever owned was stuck onto those mailboxes - but we'd decided to only use a handful in Exchange Online.&lt;/p&gt;
&lt;p&gt;When migrating the mailbox from on premise to Exchange Online, the migration failed with the message that the domains on the mailbox were not part of the list of Accepted Domains configured for Exchange Online. Obvously, we could do 2 things: Add all the domains to the Accepted Domains - or clean up the mailboxes. While it did seem like a daunting task, I opted for the latter.&lt;/p&gt;
&lt;hr class=&quot;system-pagebreak&quot; /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In retrospect, it didn't turn out to be much work: I just wrote a Powershell script that does it for me. If you want to use it, just copy/paste the script below to a text file on your Exchange server, adjust the domain names and the mailbox database in which you want to search for mailboxes, save it with a PS1 extension and run it (NB: it will NOT run on Exchange 2013 without some tweaking as I needed it for Exchange 2007)&lt;/p&gt;
&lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt;$MSOnline = &quot;domain1,com,domain2.net,domain3.org&quot;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;font-size: 12.1599998474121px; line-height: 1.3em; font-family: 'courier new', courier;&quot;&gt;Get-MailboxDatabase -Identity &quot;&amp;lt;YOUR MAILBOX DB&amp;gt;&quot; | Get-Mailbox | foreach {&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; #write-output $_.EmailAddresses.count&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt;for ($i=0;$i -lt $_.EmailAddresses.Count; $i++)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; $address = $_.EmailAddresses[$i]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; $domain = $address.AddressString.toString().Split(&quot;@&quot;)[1]&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt;if (!$MSOnline.Contains($domain) -AND $address.PrefixString -eq &quot;SMTP&quot; ) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; write-host &quot;removing $address&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; $_.EmailAddresses.RemoveAt($i)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; $i = $i – 1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; Set-Mailbox -Instance $_&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; #write-output $_.EmailAddresses.count&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt; #Write-output &quot;remaining: &quot; $_.EmailAddresses&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'courier new', courier;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt;</content>
		<category term="Exchange" />
	</entry>
	<entry>
		<title>Anonymous Relay in Exchange 2007</title>
		<link rel="alternate" type="text/html" href="https://dynamic.bubbakraut.com/msstuff/10-exchange/36-anonymous-relay-in-exchange-2007"/>
		<published>2012-11-06T10:58:54+01:00</published>
		<updated>2012-11-06T10:58:54+01:00</updated>
		<id>https://dynamic.bubbakraut.com/msstuff/10-exchange/36-anonymous-relay-in-exchange-2007</id>
		<author>
			<name>Sven Jambor</name>
			<email>admin@bubbakraut.com</email>
		</author>
		<summary type="html">&lt;p&gt;Sending mails from applications servers that don't support SMTP authentication in Exchange 2007 is easy.&lt;/p&gt;
&lt;p&gt;Just build a custom receive connector, add your servers' ip addresses, in the &quot;Network&quot; tab, turn everything off in &quot;Authentication&quot; and allow &quot;Anonymous users&quot; in the &quot;Permission Groups&quot; tab.&lt;/p&gt;
&lt;p&gt;That's it. .... most of the time.... &lt;/p&gt;
&lt;p&gt;Works great - except when it doesn't work. Like when your application also wants to mail to the rest of the world (And not just your own organization). That's called relaying - and is really, really bad if it happen without your knowledge. If you want to enable it for this connector you'll need to switch over to Powershell in the Exchange Management Shell and grant those pesky anonymous users the right to actually send to any recipient.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;To do so, use the following script:&lt;/p&gt;
&lt;pre&gt;Get-ReceiveConnector &quot;&amp;lt;your receive connector&amp;gt;&quot; | Add-ADPermission -User &quot;NT AUTHORITY\ANONYMOUS LOGON&quot; -ExtendedRights &quot;Ms-Exch-SMTP-Accept-Any-Recipient&quot;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
		<content type="html">&lt;p&gt;Sending mails from applications servers that don't support SMTP authentication in Exchange 2007 is easy.&lt;/p&gt;
&lt;p&gt;Just build a custom receive connector, add your servers' ip addresses, in the &quot;Network&quot; tab, turn everything off in &quot;Authentication&quot; and allow &quot;Anonymous users&quot; in the &quot;Permission Groups&quot; tab.&lt;/p&gt;
&lt;p&gt;That's it. .... most of the time.... &lt;/p&gt;
&lt;p&gt;Works great - except when it doesn't work. Like when your application also wants to mail to the rest of the world (And not just your own organization). That's called relaying - and is really, really bad if it happen without your knowledge. If you want to enable it for this connector you'll need to switch over to Powershell in the Exchange Management Shell and grant those pesky anonymous users the right to actually send to any recipient.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;To do so, use the following script:&lt;/p&gt;
&lt;pre&gt;Get-ReceiveConnector &quot;&amp;lt;your receive connector&amp;gt;&quot; | Add-ADPermission -User &quot;NT AUTHORITY\ANONYMOUS LOGON&quot; -ExtendedRights &quot;Ms-Exch-SMTP-Accept-Any-Recipient&quot;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</content>
		<category term="Exchange" />
	</entry>
	<entry>
		<title>Insufficient access rights to perform the operation in Exchange 2003</title>
		<link rel="alternate" type="text/html" href="https://dynamic.bubbakraut.com/msstuff/10-exchange/17-insufficient-access-rights-to-perform-the-operation-error"/>
		<published>2011-05-20T14:26:17+02:00</published>
		<updated>2011-05-20T14:26:17+02:00</updated>
		<id>https://dynamic.bubbakraut.com/msstuff/10-exchange/17-insufficient-access-rights-to-perform-the-operation-error</id>
		<author>
			<name>Sven Jambor</name>
			<email>admin@bubbakraut.com</email>
		</author>
		<summary type="html">&lt;p&gt;Heck, don't you just LOVE it when Exchange tells you that you don't have the rights to do something you need to do? Especially if you're the Über-Admin?! Happened to me today when I was moving a mailbox from an Exchange 2003 Server to a mailbox database on an Exchange 2010 machine.&lt;/p&gt;
</summary>
		<content type="html">&lt;p&gt;Heck, don't you just LOVE it when Exchange tells you that you don't have the rights to do something you need to do? Especially if you're the Über-Admin?! Happened to me today when I was moving a mailbox from an Exchange 2003 Server to a mailbox database on an Exchange 2010 machine.&lt;/p&gt;
</content>
		<category term="Exchange" />
	</entry>
	<entry>
		<title>PrepareAD complains about the Default Global Address List</title>
		<link rel="alternate" type="text/html" href="https://dynamic.bubbakraut.com/msstuff/10-exchange/3-prepareaddgal"/>
		<published>2011-03-30T23:32:50+02:00</published>
		<updated>2011-03-30T23:32:50+02:00</updated>
		<id>https://dynamic.bubbakraut.com/msstuff/10-exchange/3-prepareaddgal</id>
		<author>
			<name>Sven Jambor</name>
			<email>admin@bubbakraut.com</email>
		</author>
		<summary type="html">&lt;p&gt;Recently I was doing an Exchange 2003 to Exchange 2010 transition. When running setup.com /PrepareAD, things didn't go as expected: Exchange threw me a curve ball with the following output:&lt;/p&gt;
&lt;pre&gt;Setup is going to prepare the organization for Exchange 2010 by using 'Setup /PrepareAD'. &lt;br /&gt;No Exchange 2007 server roles have been detected in this topology. After this operation, &lt;br /&gt;you will not be able to install any Exchange 2003 or Exchange 2007 servers.&lt;br /&gt;&lt;br /&gt;Configuring Microsoft Exchange Server&lt;br /&gt;&lt;br /&gt;    Organization Preparation                                  FAILED&lt;br /&gt;     The following error was generated when &quot;$error.Clear();&lt;br /&gt;        install-GlobalAddressLists -DomainController $RoleDomainController&quot; was run: &lt;br /&gt;&quot;Active Directory operation failed on domaincontroller.company.lan. The object &lt;br /&gt;'CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container,&lt;br /&gt; CN=Our company,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=company,DC=lan' &lt;br /&gt; already exists.&quot;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Exchange Server setup operation didn't complete. More details can be found&lt;br /&gt;in ExchangeSetup.log located in the &amp;lt;SystemDrive&amp;gt;:\ExchangeSetupLogs folder.&lt;br /&gt;&lt;br /&gt;Exchange Server setup encountered an error.&lt;/pre&gt;
&lt;p&gt;That didn't look to good. Google-ing didn't do too much for me, either - I found a lot of info about incorrectly set ACLs on address lists - but that wasn't the case here.&lt;/p&gt;
&lt;p&gt;I used ADSIEdit.msc on the Domain Controller, went to the Configuration container and then down the path to where the Default Address List entry was hidden. Opening its properties was no success either, giving me the strong impression that there's something seriously corrupt here.&lt;/p&gt;
&lt;p&gt;Workaround for me: I simply renamed the CN. So now it reads &quot;CN=Invalid Exchange 2003 Default Address List&quot; - and from there on things went okay again.&lt;/p&gt;</summary>
		<content type="html">&lt;p&gt;Recently I was doing an Exchange 2003 to Exchange 2010 transition. When running setup.com /PrepareAD, things didn't go as expected: Exchange threw me a curve ball with the following output:&lt;/p&gt;
&lt;pre&gt;Setup is going to prepare the organization for Exchange 2010 by using 'Setup /PrepareAD'. &lt;br /&gt;No Exchange 2007 server roles have been detected in this topology. After this operation, &lt;br /&gt;you will not be able to install any Exchange 2003 or Exchange 2007 servers.&lt;br /&gt;&lt;br /&gt;Configuring Microsoft Exchange Server&lt;br /&gt;&lt;br /&gt;    Organization Preparation                                  FAILED&lt;br /&gt;     The following error was generated when &quot;$error.Clear();&lt;br /&gt;        install-GlobalAddressLists -DomainController $RoleDomainController&quot; was run: &lt;br /&gt;&quot;Active Directory operation failed on domaincontroller.company.lan. The object &lt;br /&gt;'CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container,&lt;br /&gt; CN=Our company,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=company,DC=lan' &lt;br /&gt; already exists.&quot;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Exchange Server setup operation didn't complete. More details can be found&lt;br /&gt;in ExchangeSetup.log located in the &amp;lt;SystemDrive&amp;gt;:\ExchangeSetupLogs folder.&lt;br /&gt;&lt;br /&gt;Exchange Server setup encountered an error.&lt;/pre&gt;
&lt;p&gt;That didn't look to good. Google-ing didn't do too much for me, either - I found a lot of info about incorrectly set ACLs on address lists - but that wasn't the case here.&lt;/p&gt;
&lt;p&gt;I used ADSIEdit.msc on the Domain Controller, went to the Configuration container and then down the path to where the Default Address List entry was hidden. Opening its properties was no success either, giving me the strong impression that there's something seriously corrupt here.&lt;/p&gt;
&lt;p&gt;Workaround for me: I simply renamed the CN. So now it reads &quot;CN=Invalid Exchange 2003 Default Address List&quot; - and from there on things went okay again.&lt;/p&gt;</content>
		<category term="Exchange" />
	</entry>
</feed>
