Wednesday, May 27, 2015

failed to uninstall last Exchange 2013

If you have to uninstall the first and last Exchange 2013 server in your org and failed with following errors:

Error:Uninstall can't continue. Database Mailbox Database XXXXXXXXX1 : This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes. To get a list of all mailboxes in this database, run the command Get-Mailbox -Database . To get a list of all mailbox plans in this database, run the command Get-MailboxPlan. To get a list of archive mailboxes in this database, run the command Get-Mailbox -Database -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database -PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database -Arbitration. To disable a non-arbitration mailbox so that you can delete the mailbox database, run the command Disable-Mailbox . To disable an archive mailbox so you can delete the mailbox database, run the command Disable-Mailbox -Archive. To disable a public folder mailbox so that you can delete the mailbox database, run the command Disable-Mailbox -PublicFolder. Arbitration mailboxes should be moved to another server; to do this, run the command New-MoveRequest . If this is the last server in the organization, run the command Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed to disable the arbitration mailbox.

This is because you have one of the following:
  • Still have folders in your Public Folders
  • Still have Mailboxes in your Mailbox Datbases
  • Still have Mailbox Databses
Exchange 2013 uses a number of different types of mailboxes as seen below. Even if you have removed all of your users mailboxes you must still remove these mailboxes:

DISCOVERY MAILBOX
DiscoverySearchMailbox {D919BA05-46A6-415f-80AD-7E09334BB852}
MONITORING MAILBOXES
HealthMailbox62256620620346798029c55bfe0fcc5d
HealthMailboxb67c72c285f54c30bad37dd37eec361a
HealthMailbox721771958fa64a53aa78527c02caf55b
HealthMailbox995793b82c2c4a14b6173e54371179ec
HealthMailboxc8603cb9bb41442e8b402db42f93dc16
ARBITRATION MAILBOXES
SystemMailbox{1f05a927-c403-4250-9f07-c5e43605c1ac}
SystemMailbox{bb558c35-97f1-4cb9-8ff7-d53741dc928c}
SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}
FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042
Migration.8f3e7716-2011-43e4-96b1-aba62d229136

These mailboxes must be removed before you can actually uninstall Exchange 2013  You can remove these mailboxes from the ECP however if you you may need to use the command below to allow you to remove the arbitration mailoxes, this command allows you to disable them
Get-Mailbox -Arbitration -Database <MailboxDatabase> | Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed
Replacing the Mailboxdatabase information with your own. Once removed if you start to unistall Exchange 2013 the uninstallation should complete

and last

Get-mailbox  -Database <mailboxdatabase > |disable-mailbox

after that try to uninstall your Exchange 2013 server again.

Good Luck!

Thursday, April 2, 2015

How to check DAG Replication Status

get-DatabaseAvailabilityGroup USDAG-10 | %{ $_.Servers | %{ GetMailboxDatabaseCopyStatus -Server $_ } }

Friday, March 20, 2015

Exchange 2010 How to re-index mailbox database

 Note: Do the below if it happens all users on the DB. If just for one user, move the user to other DB to see if the issue is gone.

Exchange 2010 re-index mailbox database
Users may report that searching Outlook for non-cached or online mode mailboxes isn't getting the right results or not returning results past a certain date. Also OWA may return "The action couldn't be completed.  Try again later." when trying to search. You need to reindex your mailbox database(s). 
1. Run Repair-ExchangeSearchSymLinks.ps1. It isn't included in the normal scripts folder under the Exchange program files, you can copy this to a text document and save it as Repair-ExchangeSearchSymLinks.ps1.
01write-host "Attempting to repair symbolic links"
02 
03write-host "Stopping msftesql-exchange and msexchangesearch services"
04stop-service -Force msexchangesearch
05stop-service -Force msftesql-exchange
06 
07$rval = get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Setup -ea SilentlyContinue
08if(!$rval)
09{
10 add-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Setup -ea SilentlyContinue
11}
12 
13write-host "Installing symbolic links"
14Install-ContentIndexingService –HubOnlyFilterRegistration
15 
16if(!$rval)
17{
18 Remove-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Setup -ea SilentlyContinue
19}
20 
21write-host "Starting msftesql-exchange and msexchangesearch services"
22start-service msexchangesearch
23start-service msftesql-exchange
24 
25write-host "Symbolic links restored."
26write-host "Please run test-exchangesearch to verify installation."
Or you can get it from Microsoft here if you don't trust me and place it in the Exchange Server\V14\Scripts folder. Open Exchange Management Shell (remember you might need to run EMS elevated and run Set-ExecutionPolicy Unrestricted first), change path to the scripts folder then run:
.\Repair-ExchangeSearchSymLinks.ps1
 
2. Next run the ResetSearchIndex.ps1 script, this one is included in the Exchange program files scripts folder so no need to download. You can run it against a specific database or against all of them as per the commands below:

.\ResetSearchIndex.ps1 -All    .\ResetSearchIndex.ps1 databasename
 
You should see event id 109 for each database stating that an index has been created and sometime later event id 110 for each database as the indexing finishes.

Thursday, March 19, 2015

How to: Move Catalog Data in Exchange 2010

How to: Move Catalog Data in Exchange 2010
 
 
When you've moved an mailbox database, the old catalog data is still present on the old partition. This prevents deleting the specific partition. When you try to delete those files, you receive this error.
 
Error description:
The Catalog data folder stays in place after a database move path action. The folder couldn't be cleaned up because it is in use by the Microsoft Exchange Search Indexing service
 
Solution:
First we have to temporarely disable the indexing on the particular mailbox database. Then we stop the indexing service of Exchange so we can delete the remaining files. The last step is to enable the indexing again.
 
Actions:
You can follow the next steps.
 
- Open the Exchange Management Shell and run the following command:

         Set-MailboxDatabase -Identity databasename -IndexEnabled $false

 -Before moving / cleaning the catalog files, stop the service Microsoft Exchange Search Indexer
         - Move the catalog files to the new database location or clean them up.
         - Start the service Microsoft Exchange Search Indexer
        - Open the Exchange Management Shell and run the following command:

    Set-MailboxDatabase -Identity databasename -IndexEnabled $true

Thursday, February 26, 2015

how to get mailbox counts per Mailbox Database quickly

How to get mailbox counts per Mailbox Database quickly

get-mailbox -resultsize unlimited | group-object -property Database -noelement

Wednesday, July 2, 2014

How to get public path via email address

You may have issue to find a public folder path that you know the email address of the PF:

Here is the cmdlet you need to find out the path:

1. Set-AdServerSettings -ViewEntireForest $true -PreferredGlobalCatalog gc1.contoso.com
2. Get-PublicFolder cmdlet to find the path via the PF's email address:

Get-MailPublicFolder AccountsPayable@domain.com | Get-PublicFolder

you will see output something like below:

Name                                                        Parent Path
----                                                             -----------
Accounts Payable                                     \Accounting\US\Americas Choice

Monday, June 9, 2014

Missing Autodiscover information in your Exchange Autodiscover XML Response?

We had issue with Outlook anywhere that cannot be configured automatically reported from remote site. When we use Remote Connectivity Analyzer (https://www.testexchangeconnectivity.com/) to test Outlook Autodiscover, all the External URL (items below the <Type>EXPR</Type> lines) was missing.

After carefully checking the output, our EXPR type output is as follow:

Type>expr</Type>
 <Server>exchange.contoso.com</Server>
 <ASUrl>https://exchange.contoso.com/EWS/Exchange.asmx</ASUrl>
 <OOFUrl>https://exchange.contoso.com/EWS/Exchange.asmx</OOFUrl>
 <OABUrl>https://exchange.contoso.com/OAB/83099da3-46bc-49e3-9e35-4353f0f95268/</OABUrl>
 <UMUrl>https://exchange.contoso.com/EWS/UM2007Legacy.asmx</UMUrl>
 <Port>0</Port>
 <DirectoryPort>0</DirectoryPort>
 <ReferralPort>0</ReferralPort>
 <SSL>On</SSL>
 <AuthPackage>Basic</AuthPackage>
 <EwsUrl>https://exchange.contoso.com/EWS/Exchange.asmx</EwsUrl>
 <SharingUrl>https://exchange.contoso.com/EWS/Exchange.asmx</SharingUrl>
 <EcpUrl>https://exchange.contoso.com/ecp/</EcpUrl>
 <EcpUrl-um>?p=customize/voicemail.aspx&amp;exsvurl=1</EcpUrl-um>
 <EcpUrl-aggr>?p=personalsettings/EmailSubscriptions.slab&amp;exsvurl=1</EcpUrl-aggr>
 <EcpUrl-mt>PersonalSettings/DeliveryReport.aspx?exsvurl=1&amp;IsOWA=&lt;IsOWA&gt;&amp;MsgID=&lt;MsgID&gt;&amp;Mbx=&lt;Mbx&gt;</EcpUrl-mt>
 <EcpUrl-ret>?p=organize/retentionpolicytags.slab&amp;exsvurl=1</EcpUrl-ret>
 <EcpUrl-sms>?p=sms/textmessaging.slab&amp;exsvurl=1</EcpUrl-sms>
 </Protocol>
 <Protocol>


and normal output should be as follows:

<Type>EXPR</Type>
 <Server>exchange.contoso.com</Server>
 <ASUrl>https://exchange.contoso.com/EWS/Exchange.asmx</ASUrl>
 <OOFUrl>https://exchange.contoso.com/EWS/Exchange.asmx</OOFUrl>
 <OABUrl>https://exchange.contoso.com/OAB/83099da3-46bc-49e3-9e35-4353f0f95268/</OABUrl>
 <UMUrl>https://exchange.contoso.com/EWS/UM2007Legacy.asmx</UMUrl>
 <Port>0</Port>
 <DirectoryPort>0</DirectoryPort>
 <ReferralPort>0</ReferralPort>
 <SSL>On</SSL>
 <AuthPackage>Basic</AuthPackage>
 <EwsUrl>https://exchange.contoso.com/EWS/Exchange.asmx</EwsUrl>
 <SharingUrl>https://exchange.contoso.com/EWS/Exchange.asmx</SharingUrl>
 <EcpUrl>https://exchange.contoso.com/ecp/</EcpUrl> ;
 <EcpUrl-um>?p=customize/voicemail.aspx&amp;exsvurl=1</EcpUrl-um>
 <EcpUrl-aggr>?p=personalsettings/EmailSubscriptions.slab&amp;exsvurl=1</EcpUrl-aggr>
 <EcpUrl-mt>PersonalSettings/DeliveryReport.aspx?exsvurl=1&amp;IsOWA=&lt;IsOWA&gt;&amp;MsgID=&lt;MsgID&gt;&amp;Mbx=&lt;Mbx&gt;</EcpUrl-mt>
 <EcpUrl-ret>?p=organize/retentionpolicytags.slab&amp;exsvurl=1</EcpUrl-ret>
 <EcpUrl-sms>?p=sms/textmessaging.slab&amp;exsvurl=1</EcpUrl-sms>
 </Protocol>
 <Protocol>


Do you see the difference between ours and normal Type>expr</Type> vs <Type>EXPR</Type>?

lowercase expr vs Uppercase EXPR.
Oups, EXPR is case sensitive here!!!
Check our Exchange configuration

>get-OutlookProvider -id expr |FL


RunspaceId           : a86dfb0a-3f3f-4b39-a264-cd6cd993853d
CertPrincipalName    :
Server               :
TTL                  : 1
OutlookProviderFlags : None
AdminDisplayName     :
ExchangeVersion      : 0.1 (8.0.535.0)
Name                 : expr
DistinguishedName    : CN=expr,CN=Outlook,CN=AutoDiscover,CN=Client Access,CN=contoso,CN=Microsoft Exchange,CN=Serv
                       ices,CN=Configuration,DC=contoso,DC=com
Identity             : expr
Guid                 : 57b60bde-e415-4ce2-b618-5a2425a230e7
ObjectCategory       : contoso.com/Configuration/Schema/ms-Exch-Auto-Discover-Config
ObjectClass          : {top, msExchAutoDiscoverConfig}
WhenChanged          : 3/3/2014 2:53:33 AM
WhenCreated          : 3/3/2014 2:41:58 AM
WhenChangedUTC       : 3/3/2014 7:53:33 AM
WhenCreatedUTC       : 3/3/2014 7:41:58 AM


As you can see above it seems some admin created Identity             : expr WhenCreated          : 3/3/2014 2:41:58 AM.
This is the root cause of the issue and the following cmdlet that helped us to fix the issue

Remove-OutlookProvider -Identity expr
New-OutlookProvider -Name EXPR

After that, run the following command to verify and test Outlook Anywhere works fine after that.

 >get-OutlookProvider -id expr |FL

RunspaceId           : 0c0cf3a8-ad17-432c-8b8d-0d6daabe64df
CertPrincipalName    :
Server               :
TTL                  : 1
OutlookProviderFlags : None
AdminDisplayName     :
ExchangeVersion      : 0.1 (8.0.535.0)
Name                 : EXPR
DistinguishedName    : CN=EXPR,CN=Outlook,CN=AutoDiscover,CN=Client Access,CN=contoso,CN=Microsoft Exchange,CN=Serv
                       ices,CN=Configuration,DC=randomhouse,DC=com
Identity             : EXPR
Guid                 : 49918614-cafb-4193-9f06-bdb2287c31f1
ObjectCategory       : contoso.com/Configuration/Schema/ms-Exch-Auto-Discover-Config
ObjectClass          : {top, msExchAutoDiscoverConfig}
WhenChanged          : 6/4/2014 2:55:02 PM
WhenCreated          : 6/4/2014 2:45:24 PM
WhenChangedUTC       : 6/4/2014 6:55:02 PM
WhenCreatedUTC       : 6/4/2014 6:45:24 PM


By the way, for those who ran the test and got the following error:

"The EXCH provider section is missing from the Autodiscover response" message and Exchange 2010 Outlook Anywhere (RPC over HTTP) not working

here is the fix for this:

The EXCH provider section is missing from the Autodiscover response"
 
I'm sure, you already checked all Internal / External URL settings
But, have you checked your Mailbox Database settings and see what do you have configured as RPCClientAccessServer? You can do this by running the following cmdlet:
 
Get-MailboxDatabase | fl Server, RPCClientAccessServer
 
If your RPCClientAccessServer is not set or set not exactly as it supposed to be, you can  correct this as illustrated in the following example:
 
Set-MailboxDatabase -Identity "MYMBXDB-1″ -RpcClientAccessServer outlook.contoso.com
 
Note: In this case outlook.contoso.com is a FQDN name of my Network Load balancer



Tuesday, May 27, 2014

How to use OAB Global Web Distribution in Exchange Server 2010


In Today's post I am going over a nice feature that is not used a lot in most of the customers that I worked with which is the Global web Distribution for OAB.
In the default OAB we will see something like this for the Default Offline Address Book. In a normal situation we would go there and enable the Web-based distribution and add the servers which is totally fine when you have a few servers and you don't change a lot.
However let's think for a moment in environment with lots of sites where all sites have Exchange Servers, or in multi-tenancy environment where several servers are added/removed in a monthly basis. For our environment, once we tried to add new server, it takes forever to get our server list
The automatic solution!
There is a neat solution called GlobalWebDistributionEnabled on each Offline Address Book. What this feature does is that configures automatic any new CAS server to receive the OAB which is great. If you want to do that
 
In order to get the information about any given OAB we can run the following cmdlet:
Get-OfflineAddressBook | Select Name,Version,AddressLists,Global* | fl
Cool, eh? If you want to enable that we just need to run the following cmdlet
Set-OfflineAddressBook –Identity '\Default Offline Address Book' –GlobalWebDistributionEnabled $True
Now if an administrator goes there to try to add something that is going to be the message that you won't able to add the server since you have GlobalWebDistributionEnabled.
Note: The Public folder distribution method is not impacted by this procedure so it's up to you whether you enable or not such feature.

Thursday, March 6, 2014

Configure the Autodiscover Service to Use AD Site Affinity

Set-ClientAccessServer -Identity "ServerName" -AutodiscoverSiteScope "Site-A","Site-B","Site-C"

Monday, January 13, 2014

Upgrade Distribution List from Exchange 2003 to Exchange 2010

Issue: We run issue with very strange mail routing. We are still in mixed mode with Exchange 2003 and Exchange 2010. One of users reported email delay happened to a specific DL.

Troubleshooting Steps:

After login to one of the mailboxes who received the email and found out very interesting routing behavior from the message headers:

Message was sent from an internal 3rd application, via port 25's PMTA. The message reached Exchange 2010 hub first, then forwarded to Legacy Exchange 2003 Connectors, then sent back to the Exchange 2010 Hub and back to users' mailbox on Exchange 2010.

The delay happened with some disk issue on one of legacy Exchange 2003 connector servers. First though could be due to the DL that has not be upgraded to Exchange 2010. Spent some time to upgrade all DLs at our Domains that all mailboxes have been upgraded to 2010 for a while. Working with scripts to remove space from alias, incorrect characters from DL alias such as "@", "(" or ")", BTW, here is the cmdlet I used to remove space, @, (, or ):

Get-DistributionGroup -ResultSize unlimited | foreach {$_.alias = $_.alias -replace '\s|,|\.'; $_} | Set-DistributionGroup
for removing space from alias or

Get-DistributionGroup  -ResultSize unlimited | foreach {$_.alias = $_.alias -replace '\s|,|\.' -replace '\(|,|\.' -replace '\)|,|\.' -replace  '\@|,|\.'; $_} | Set-DistributionGroup

Then run force upgrade of the DLs:

Get-DistributionGroup –ResultSize Unlimited | Set-DistributionGroup –ForceUpgrade

After that, you may still get some issue with some of DLs that you may have to manually upgrade.

All of DLs have been upgraded and the issue still existing.

After digging, and found out one of the Legacy Exchange 2003 Connector servers were running out of space. fixed the issue, reboot all Ex2003 connector servers and Exchange 2010 hub servers. Delay issue has been resolved, however, the strange email routing issue still existing.

Get-DistributionGroup   |FL printed output to file and focused on print out of the DL we had the issue.

Finally I found the settings of the DL was specified with the legacy Exchange 2003 server that we had issue as expansion server. After removed the expansion server, The strange routing issue has been resolved.

Here is the cmdlet I used to change all possible DLs that may have such settings:

Get-DistributionGroup –ResultSize Unlimited | Set-DistributionGroup -ExpansionServer $Null

Keyword: DistributionGroup upgrade, Exchange 2003 connector, Routing issue, Expansion Server of DL.



Tuesday, October 29, 2013

How to Disable Autodiscover in Outlook 2010/2013


There is an MS KB article to reference and Outlook 2007 and 2010 ADM files http://support.microsoft.com/kb/2612922. The ADM files attached to the article were great because they gave a way to disable the different methods Outlook uses to determine autodiscover in Outlook 2007 and 2010. Outlook (generically) uses 5 methods to determine discoverer.
  1. SCP object lookup
  2. Root domain query based on your primary SMTP address
  3. Query for the AutoDiscover domain
  4. HTTP redirect
  5. SRV record query in DNS
Unfortunately Outlook 2013 is a little new and MS doesn't have a nice preconfigured ADM. That's ok because the exact same methods for autodiscover are used in 2013 as they were in previous version.
We can create a reg file for 2013 by exporting the key that gets created when the ADM is applied via GPO for 2010 and just changing the registry path. So instead of:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\14.0\Outlook\AutoDiscover
I changed it to:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\15.0\Outlook\AutoDiscover
You can change the various options from the registry file as well. They are:
"ExcludeScpLookup"=dword:00000001
"ExcludeHttpsRootDomain"=dword:00000000
"ExcludeHttpsAutoDiscoverDomain"=dword:00000000
"ExcludeHttpRedirect"=dword:00000000
"ExcludeSrvRecord"=dword:00000000
Above the SCP lookup is disabled.
 

Friday, October 18, 2013

How to use the ADModify.NET tool to add an X.500 proxy address to multiple accounts

How to use the ADModify.NET tool to add an X.500 proxy address to a user account
Admodify2.1 nolonger support X500 tab entry, thus we will have to use custom tab.
 
X500 addresses are useful once we migrated volume of mailboxes from another organization and we enabled GAL sync between Exchange organizations before migration. Lack of the lagacyExchangeDN of old organization or x500 address, migrated users may get NDR once they tried to reply to existing emails to certain users.
  1. Click the Custom tab.
  2. Under Custom Attribute Set, follow these steps:
  3. Click to select the Make a customized attribute modification check box.
  4. In the Attribute Name box, type proxyAddresses.
  5. In the Attribute Value box, type the X.500 address.

    For example, if you want an X.500 address of /o=OldOrganization/ou=OldSite/cn=Recipients/cn=mailNickname, type the following in the Attribute Value box:
    X500:/o=OldOrganization/ou=OldSite/cn=Recipients/cn=%'mailNickname'%


    In this example, we use the %'mailNickname'% variable because we assume that the mailNickname attribute in the new organization matches the mailNickname attribute in the old organization. If these attributes do not match, use another variable.

    Note If the migrated user account is from an Active Directory directory service environment, use the Adsiedit tool to locate the old legacyExchangeDN attribute of the user. Then, use the old legacyExchangeDN attribute for the X.500 address.
  6. Click Multivalued Append, and then click Go.
 
 
 

Use Poolmon to identify Exchange 2010 mailbox server memory leaking issue

We have four hardware identical Cisco UCS servers that installed as Exchange mailbox servers mailbox role and joined DAG replication partners. Two local servers are working fine. However, two remote servers keeping running out of memory and we had to reboot these two servers at regular base (once a month) until we used Poolmon to identify the cause of the memory leaking, a known Cisco NIC teaming bug. Poolmon was able to identify with tag Team caused memory leaking that consumed more than 5 GB nonpaged memory before the server running out of available memory less than 20MB of 96 GB physical RAM and Hard Faults per sec pager constantly reached 100.
 
Once poolmon identify tag Team, then we used the following string to find the driver that caused the memory leaking:
 
findstr /m /l team *.sys either of system32  or \system32\drivers directory.
 
for more info, please read the following links:
 
 

Wednesday, October 2, 2013

How to Disable Attachment Filtering on Exchange 2010 Edge Transport

We had an interesting issue recently where our Exchange 2010 Edge Transport server was erroneously stripping out .docx, .xlxs, and .pdf files. 
 
There is a Microsoft KB to address the issue, however, it doesn't work for us.
 

The attachmentfilteragent has been enabled by default, and I wanted it off, so we needed to add an exception for our receive connector. It's not as straightforward as you would expect though to turn off attachment filtering on an Exchange 2010 Edge Transport server.
 
The first step is to see if there are any connectors on the attachment filter exception list presently.  To do so, run this command:
 

Get-AttachmentFilterListConfig
 
About the fifth line down you should see "ExceptionConnectors" which probably has nothing next to it. 
You can only turn off attachment filtering by referencing the GUID, so now we need to get the GUID of the relevant receive connector. 
 

Get-ReceiveConnector  | Format-List
 
This will give us all the properties of our Receive Connector, including the GUID, which will be listed about 10 lines up from the bottom. Now that we have the GUID, we can run the command to add the receive connector to the list of exceptions for attachment filtering by running this:
 

Set-AttachmentFilterListConfig –ExceptionConnectors [GUID]
 
Replacing [GUID] with the GUID we retrieved in the previous step.
 
Finally, run Get-AttachmentFilterListConfig again and check the Exceptions line, you should now see your receive connector listed there.
 
reference link:
 

Monday, August 5, 2013

Move Public Folder Content from One Public Folder Database to Another Public Folder Database

Use the MoveAllReplicas.ps1 script to move all public folder content from one server to another server
 

To move all public folders in a public folder database on one server to a public folder database on another server, use the MoveAllReplicas.ps1 script. This script replaces a server with a new server in the replication list for all public folders, including system folders. For more information about using public folder scripts, see Scripts for Managing Public Folders in the Exchange Management Shell.

This example moves all public folder content from Server01 to Server02.

cd $EXscripts

.\MoveAllReplicas.ps1 -Server Server01 -NewServer Server02
 
If you are move from Exchange 2007 to Exchange 2010, you had better run the scripts from Exchange 2010 servers.
 
However, I would prefer you run the following script first, and make sure all public folders including system folders are replicated to new server first,
 
1. run Get-PublicFolder -Server OldPFServername -Recurse | FL Name,Replicas
 
If there is any issue, fix it first, say, some of old PF folders may contain leading or trialing whitespace that no longer support in new Exchange server.
 

WARNING: The Name property
contains leading or trailing whitespace, which must be removed.
 

2. use AddReplicaToPFRecursive.ps1 to replicate all Folders to new server
 
[PS] C:\Program Files\Microsoft\Exchange Server\V14\Scripts>.\AddReplicaToPFRecursive.ps1
 

AddReplicaToPFRecursive.ps1 -Server "MyEx2007Server" -TopPublicFolder "\" -ServerToAdd "MyEx2010Server"
 
3.\AddReplicaToPFRecursive.ps1 -Server "MyEx2007Server" -TopPublicFolder "\NON_IPM_Subtree" -ServerToAdd "MyEx2010Server"
 
The above command will add replica of all public folders to exchange 2010 public folder database.
Once the replica is added you can move the replica from Exchange 2007 to Exchange 2010. To do this execute the below EMS command:

4. .\MoveAllReplicas.ps1 -Server "MyEx2007Server" -NewServer "MyEx2010Server"
 
 

OfflineAddressBook, PublicFolderDatabase still points to old Exchange server

 
After migrating your Exchange server   (I've seen this in transition  from Exchange 2003 to Exchange 2007 and from Exchange 2007 to 2010) the PublicFolderDatabase for your OfflineAddressBook is still pointing to the old servers public folder store.
 
When you run the get-OfflineAddressBook | fl command or Get-OfflineAddressbook | FL Server, *public* |FL in an exchange management shell on your new server, you get a result like this:
 
At Server you see the new servername and the PublicFolderDatabase is still pointing to your old server. Public folder replica's and offline address book generation server are already moved to the new server.
 
Solutions: I found if you do the following steps you can change the PublicFolderDatabase.
 
1. Start adsiedit and browse to CN=Configuration, CN=Services, CN=Microsoft Exchange, CN=First Organization, CN=Address Lists Container, CN=Offline Address Lists and open the properties of CN=Default Offline Address List Look for the siteFolderServer attribute, here you will see the old public folder store.
 
2. Choose clear and close with ok, now you may close adsiedit.
 
3. Go to the exchange management console, Organization Configuration, Mailbox, Offline Address Book open the properties of the Default Offline Address List and go to the tab distribution. Uncheck "Outlook version 2 and 3″ at client support and "Enable public folder distribution". Make sure "Web-based distribution" is enabled. Choose apply and ok, then right click on Default Offline Address List and choose update.
4. Go back to properties and distribution and recheck "Outlook client support version 2 and 3″ and "Enable public folder distibution". Again choose apply and ok and right click and choose update. When you go back to the exchange management shell and repeat Get-OfflineAddressbook | FL Server, *public* |FL  now you now will see the PublicFolderDatabase is  pointing to your new public folder server now.
 
 

Tuesday, June 4, 2013

How to Delete Mail from Multiple Mailboxes

How to Delete Mail from Multiple Mailboxes
 
Issue:

I had this recently where a spam email had went around.  I needed to find a way to delete the email from every mailbox. This can be done from Powershell command:
 
NOTICE out of the box these commands are not enabled, you will need to see this article first if you have not already enabled them – Enable Export Mailbox Commands In Exchange 2010
 
 
Once the above is done you can now proceed the following powershell cmdlet:
 
get-mailbox -result unlimited -Server YourServername | Search-Mailbox -SearchQuery 'Subject:"Your XYZ order"', 'from:"mailto:sender@xyz.com%22', 'body:"your body text"' -TargetMailbox hltest -TargetFolder "xyzspam"  -LogLevel full -DeleteContent >C:\deletedxyz10.txt
 
Where  YourServername is your mailbox server and "Your XYZ order" is the subject content, from, and body, you can search for one of them, or combination of two or three
 
You will need to use an account that has the correct permissions to give the correct permissions to the user use this command
get-mailbox -server "yourservername"| add-mailboxpermission -user administrator -AccessRights FullAccess
That command will give the correct rights to the administrator account.
 
With above commands you will be able to remove email from multiple mailboxes in Exchange 2010 and Exchange 2013.

How to Enable Export-Mailbox or Import-Mailbox Powershell commands

When using powershell in  Exchange 2010 or Exchange 2013 and you try Export-Mailbox or Import-Mailbox the commands or delete messages from multiple mailbox, you will get error since these are not available by default, we need to enable them…
 
Note, if you are running exchange 2010 SP1 and above and you are trying to delete multiple emails then go here http://www.techieshelp.com/delete-mail-from-multiple-mailboxes/
IT Solution
1) Check if you have the Exchange Server Admin Tasks installed in the Exchange Management Shell
 

Get-PSSnapin
 
2) It should not be in the list displayed as you cannot run the command. Run the command below to see what is registered.
 

Get-PSSnapin -registered
 
3) Now to install the appropriate "Admin Tasks for the exchange Server" run the command below:
 

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
 
NOTE: for MS Exchange 2007 you should change the point (3) to a command like the one below:
 

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
 
You will now find the import and export commands are available in powershell
If you want to add multiple users or groups to be able to run these commands use the command below, it will create two new security groups with the members you specify.
New-RoleGroup -Name "Exchange Mailbox Import Export" -Roles "Mailbox Import Export" -Members "<yourdomainyourgroupname>" -DisplayName ""Exchange Mailbox Import Export" -Description "This group handles permissions to the import and export commands in powershell."
That creates a group and adds users who are allowed access to the import and export powershell commands.
New-RoleGroup -Name "Exchange Support and Diagnostics" -Roles "Support Diagnostics" -Members "" -DisplayName ""Exchange Support Diagnostics" -Description "This group handles permissions to the support diagnostics cmdlets in exchange."."
That creates a group and adds users who are allowed access to all the exchange powershell diagnostics applets
 

Wednesday, May 22, 2013

Get-DistributionGroupMember

1. Get-DistributionGroupMember from a regular DL
 
Get-DistributionGroupMember -identity "mydl" | Export-Csv C:\MyFile.Csv
 
Where mydl is our distribution group, and myfile.csv is the resulting CSV file.
 
2. Get-DistributionGroupMember from a Dynamic DL
 
$members = Get-DynamicDistributionGroup -Identity "dynamicgroupname"
 
Get-Recipient -RecipientPreviewFilter $members.RecipientFilter > C:\MyDDLmembersall.txt

 

How to create or remove ForeignConnector Exchange 2010

After migrating from Exchange 2007 to Exchange 2010, we are in process of decommiossion of Exchange 2007. Since we have AccuRoute Fax, so we need to change Fax ForeignConnector from Exchange 2007 Hub to Exchange 2010 Hub.
 
Here is the cmdlet we used for the migration,
 
Remove-ForeignConnector "AccuRoute Fax Connector"
New-Foreignconnector "AccuRoute Fax 10 Connector" -AddressSpaces "FAX:*;1" -SourceTransportServers "hub10-1","hub10-2", "Hub10-3"
Set-Foreignconnector -Identity "AccuRoute Fax 10 Connector" -Maxmessagesize 20Mb -dropdirectory "file://fax-10/Drop$"
 
If you need the connected be scoped for local AD site, the following cmdlet need to be run:
 
Set-Foreignconnector -Identity  "AccuRoute Fax 10 Connector" -Isscopedconnector true$
 

Wednesday, May 1, 2013

Email Routing Using Exchange Cost for Multiple AD Sites In Exchange 2010

Exchange 2010 uses AD Sites and Services information to route emails from one AD site to another. All site links will have a default AD cost of 100. Smaller companies might leave the configuration as it is, as they will only have a single site in most cases.
 
Larger organizations will have fairly good number of AD sites and the AD site links will be configured with the appropriate AD cost for the links. By default, Exchange 2010 uses the link which has the least AD cost to send emails from one AD site to another. You may come across organizations where the AD costs will have to be altered for an efficient email routing, but you won't be given the go ahead. This mostly happens in large organizations, as changing the existing AD site costs may affect the production network or the AD team just don't want to make any changes.
Exchange 2010 (actually 2007 as well) has a solution for the above scenario. There is a way by which you can change the email routing without making any changes to the AD site link costs. It is known as "Exchange Cost" and is not configured by default.
Once an exchange cost for a site link is specified, it overrides the AD link costs for email routing.  By going so, it only overrides the email routing topology.
 
Set-ADSiteLink –identity "link name" –ExchangeCost "cost"
The maximum message size that passes through a site link can be restricted as well. It will come in handy if the link between the site is not great. Run the command below to specify a size limit for communications between various AD sites.
Set-ADSiteLink –identity "link name" –MaxMessageSize "size"

Tuesday, April 30, 2013

How to restore Exchange 2007 /2010 Organizational Form Library from Backup Tape

We run issue, all suddenly all of our Exchange 2010 Orgnaizational Forms Library are missing. We have full backup of Exchange 2007 public folder server. Here are the steps we did to restore the forms only to Exchange org:
 
1. Setup a restore server in Lab with different domain from production. Install Exchange 2007 server with the same SP with production.
2. Create a public folder database with the same public folder Database name (note: storage group name could be different). right click the Database, enable the database can be overwitten by a restore.
3. create Organizational forms Library (same as production)
4. follow the following link:
you may skip step 3 if you are working on Exchange 2007 server.
5. dismount the public folder database
6. run restore from backup tape (we use Symantec Backup Exec 2012 R3) (note only select the database, don't select log files)
7. After the restore, the public DB was mounted  automatically.
Note: 1). we had issue to see Organizational Forms Library from Outlook when I missed Step 4 above
Note: 2). after step4 to setup PR-EForm-Local-ID 1033 (for English), I was able to see the Organization Form Library, but there are no forms at all and got error load forms failed. You don't have permission, etc.
Double check restore LAB, realized there is another Exchange 2007 public folder database but DB was dismounted due to missing drive. So move the DB to different drive with -configurationOnly option using ps cmdlet. then mount the DB with empty DB. Then enable replication from the restored the public folder server to that empty public DB for Organization Forms Library only.
8. Create mailbox on a mailbox DB with Client public folder pointing to the restored public DB.
Open Outlook, now I see all forms there.
9. follow the following link to save the resored Orgnaizational forms to PST file.
Copy the pst to a Outlook profile with production mailbox, then copy the forms from the pst to Organizational Forms Library in production.
 
Note: If your organization users still depends on Organizational Forms Library, the follow the link to make a copy of forms to a pst file to make your life easy : http://support.microsoft.com/kb/190994
 

Thursday, April 25, 2013

Setting Message Size Limits ifor Exchange 2010 organization

 
Although you may have setup Max message size on every Hub sending /receiving connectors to more than 10 MB, say 20 MB, your users may still the following error:
 
The recipient won't be able to receive this message because it's too large.
The maximum message size that's allowed is 9 MB. This message is 10 MB.
 
The organizational send and receive size limits apply to all Exchange servers in the Organization. The default is 10MB.
You can modify the organizational message size limits using the Set-TransportConfig cmdlet from the Exchange shell:
 
Set-TransportConfig -MaxReceiveSize 20MB -MaxSendSize 20MB

Exchange 2010 Legacy Relay needs to increase maximum connections per source

Move Exchange 2010 Legacy Relay (PowerPMTA) from Exchange 2003  connector server to Exchange 2010 Hub
 
you will see connections per source exceed the limit error. By default, Exchange 2010 Hub only offer 20 connection per source IP.
 
Solution:
 
Create a dedicated receiving connector for PMTA. from Exchange 2010 Powershell
 
get-receiveconnector -id "hubServername\From PMTA" |FL
 
to see what parameters need to be modified to meet your needs, then run
set-receiveconnector -id "hubServername\From PMTA"  -MaxInboundConnectionPerSource 500 -MaxInboundConnectionPercentagePersource 10
 
Note: by default, MaxInboundConnection per server is set 5000, thus 500/5000 =10%

Just finished Exchange 2010 Project

will update my Blog soon.
 

Thursday, October 18, 2012

Site Mailboxes , Shared Mailboxes and Public Folder Exchange 2013 Outlook 2013

A site mailbox brings Exchange emails and SharePoint documents together. For users, a site mailbox serves as a central filing cabinet, providing a place to file project emails and documents that can be only accessed and edited by site members.
 

What is the difference between site mailboxes, shared mailboxes and public folders?

Site mailboxes

For groups of people that are working together on a shared set of deliverables. They want to keep important emails and documents in one place.
The content is scoped to a particular project that a small team is working on. As such, all content in that mailbox is highly relevant to the team members.
User will not see a site mailbox in their Outlook client unless they are an owner or member of that site mailbox.

Shared mailboxes

A group of people is working on behalf of a virtual entity (e.g. help@contoso.com). They are triaging incoming emails against a shared inbox and responding on behalf of the virtual entity.
Integrated document collaboration is not a requirement for this scenario.
Users will usually only do this for one shared mailbox and the mailbox is added manually to the user's Outlook profile.

Public folders

Public folders hold the full body of shared email knowledge in an organization.
Public folders are a great technology for distribution group (DG) archiving. A public folder can be mail enabled and added to the DG. Emails that are sent to the DG will be automatically added to the public folder for later reference.
Documents should not be stored in public folders since they don't support co-authoring or version management like SharePoint.
 
 

Tuesday, September 18, 2012

Make sure UPN Values Are The Same As Primary Email Addresses

If you are running Exchange 2007 or newer:
  1. Launch the Exchange Management Shell from your Start Menu (available in Exchange 2007 and newer versions)
  2. Copy and paste the following command into the window:
Get-User | Where { -Not [string]::IsNullOrEmpty($_.WindowsEmailAddress) } | ForEach { Set-User -Identity $_.Guid.ToString() -UserPrincipalName $_.WindowsEmailAddress.ToString() }
What this script and command will do is change the UPN of all user's to be the same value as their Primary email address. Once the command finishes, launch the Active Directory Users and Computers snap-in and verify that the UPN is the same value as the email address.
You're now ready to perform a directory synchronization!
 

How to Add a UPN Suffix to a Forest

  1. Open Active Directory Domains and Trusts.
  2. Right-click Active Directory Domains and Trusts in the Tree window pane, and then click Properties.
  3. On the UPN Suffixes tab, type the new UPN suffix that you would like to add to the forrest.
  4. Click Add, and then click OK.
Now when you add users to the forest, you can select the new UPN suffix to complete the user's logon name.

Thursday, May 10, 2012

One or more users cannot be added to the folder access list. Non-local users cannot be given rights on this server

One or more users cannot be added to the folder access list. Non-local users cannot be given rights on this server
 
Keyword: Public Folder permission sharing, Exchange 2007, public folder permission, Distribution list, security group
 
Once I tried to share a public folder to the DL, I got the following error:
"One or more users cannot be added to the folder access list. Non-local users cannot be given rights on this server"
 
The first reaction is I have to concert the DL to security group and set it as Universal Group type as an MS KB (support.microsoft.com/kb/941318) mentioned. I used ADUC to make the change. However, it still doesn't work.
 
I know since Exchange 2007, you cannot assign a public folder to a shared mailbox and we have to run
 
set-mailbox -id "username" -type regular
 
I checked members of the group, and changed some of shared mailbox to regular, however, I still got the same error.
 
Why this has happened.
 
This has been a known problem since Exchange 2007. Essentially there's an active directory attribute called "msExchRecipientDisplayType" that does not get changed properly when you convert the group using the GUI interface.
 
How to Fix it
Exchange 2007
Run the following Powershell command in the Exchange Management Shell:
 
Set-DistributionGroup -Identity "thegroupname"

Exchange 2010
 
If you run that command on Exchange 2010, you will see the error (shown above)
"Members can't remove themselves from security groups. Please set the group to Closed for requests to leave."
 
You need to run the following Powershell command, in the Exchange Management Shell instead:
 
Set-Distributiongroup–identity {group name} –MemberDepartRestriction Closed
 
After that, update your Global address list, offline address list, restart Exchange file disitribution services on your all CaS servers, and f9 to download update your offline address on your Outlook. Or use online Outlook profile if you are in rush, you should be all set.
 
Summary
 
Issue:
 
You got error: "One or more users cannot be added to the folder access list. Non-local users cannot be given rights on this server" once you try to assign a DL to public folder permission.
 
You tried

1. You converted the DL to security group and changed the group type to Universal Group using ADUC
 
2. You checked member of the group and make sure you changed shared mailbox type to regular using the following cmdlet:
 
set-mailbox -ID username -type regular
 
3. You set the group using the following cmdlet:
 
for Exchange 2007
 
Set-DistributionGroup -Identity "thegroupname"
 
For Exchange 2010,

Set-Distributiongroup–identity "thegroupname" –MemberDepartRestriction Closed

Tuesday, May 8, 2012

Troubleshooting Exchange 2010 DAGs Across WANs

After we established Exchange 2010 LAB across three sites, Exchange 2010 Database Availability Groups across multiple sites and WAN connectivity work most of time. However, once our network connectivity experiences issue between sites, I recently found myself troubleshooting an inconsistent issue at one remote site.
 
The issue reported by the following link, however, it seems there is no resolution yet.
http://social.technet.microsoft.com/Forums/eu/exchange2010/thread/40a37573-d967-41b0-b0d2-8a9f7ae530eb 
 
you can see our network (Exchange 2010) settings via the following link:
 
 
Once this happened, from remote site server EMC, Mailboxes Database Status across WAN is shown as Unknown and from NY and WM (site)  servers, copy status for all database copies on SIXLABMBX-1 as "ServiceDown." Running Get-MailboxDatabaseCopyStatus against the DAG member(s) in the remote data center reflected the same results. Databases in an "Unknown" mount state corresponded to cases where the database was activated in one data center and status was being queried across the WAN from the other data center.
There were several Windows event logged on both SI and NY servers:
 
Event ID 2060
 
The Microsoft Exchange Replication service encountered a transient error while attempting to start a replication instance for NYXLABMBX1DB-1\SIXLABMBX-1. The copy will be set to failed. Error: The NetworkManager has not yet been initialized. Check the event logs to determine the cause.

Event ID 2153
 
The log copier was unable to communicate with server 'NYXLABMBX-1.exlab.randomhouse.com'. The copy of database 'NYXLABMBX1DB-1\SIXLABMBX-1' is in a disconnected state. The communication error was: Communication was terminated by server 'NYXLABMBX-1.exlab.randomhouse.com': Data could not be read because the communication channel was closed. The copier will automatically retry after a short delay.
 
Event ID 2058
 
The Microsoft Exchange Replication service was unable to perform an incremental reseed of database copy 'NYXLABMBX-1DB3\SIXLABMBX-1' due to a network error. The database copy status will be set to Disconnected. Error An error occurred while communicating with server 'NYXLABMBX-1.exlab.randomhouse.com'. Error: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
 
This doesn't happen between WM and NY servers.
 
We found out the only solution for this is to reboot the server one by one, then DAG will show healthy after that. That's a big headache.
 
After digging and digging, we have found a link that talking about MTU (Maximum Transmission Unit). By default, Windows NIC is automatically set MTU (1500), and Windows operating system uses MTU (Maximum Transmission Unit) determines the maximum size of the largest protocol data packet unit (including the size of the transport header) that can be transmitted over the underlying network layer. MTU parameters usually appear in association with a communications interface (NIC, serial port, etc.), and is configured separately for each network interface. We can test MTU settings across WAN by pinging remote IP with -f -l (packet size) option,
For example, from NY server, we can ping 10.102.52.18 -f -l 1200,  where 1200 is packet size, we want to test…, then try 1300, 1400, 1500 …
By default, router's MTU is set between 1480 to 1500, deducting some packet transport headers, from NY to WM server, we can ping wmxhub-1 –f –l 1470 with no problem, failed 1475. That's normal. However, from NY to SI site, it only allow maximum packet size around  (1365), it failed 1370 (ping 10.102.52.17 -f -l 1365, OK and ping 10.102.52.17 -f -l 1370 failed). We talked with Network team about this, I was told that this is due to fact that we have private circuit between WM and NY, and only VPN connection between SI and NY that offset a bigger packet overhead. Usually server and network equipment will adjust packet size automatically.
We use "netsh interface ipv4 show subinterfaces " command to check default MTU size on the mailbox servers that are member of DAG and found out default NIC MTU is 1500, while Microsoft set Cluster NIC MTU to 1300. Since we don't use dedicated NIC for replication traffic, thus the server will use default NIC to transport replication traffic, and it seems Windows cannot automatically adjust MTU accordingly.
 
Then we use the following command to set default NIC MTU to 1300
 
netsh interface ipv4 set subinterface "Local Area Connection 3" mtu=1300 store=persistent
 
and use netsh interface ipv4 show subinterfaces to show MTU to make sure both cluster NIC and default NIC have the same size of MTU (1300)
 
After we did these on all mailbox servers that are member of DAG, then we restarted replication services on all DAG members, the issue has been resolved automatically.
 
 

Monday, April 16, 2012

Use MDSPushvsPull.exe to trace Blackberry Device Data usage for troubleshooting

We had issue with one of our BES users whose data usage was over 2.5 GB per month, our regular users' usage is less than 500 MB per month. We use BES 5.0.3. After we installed resources Kits, we are able to check data usage per device on our BES server and found out one of applications the user installed on the device may have bug that caused consistent data connection to its server.
C:\Program Files (x86)\Research In Motion\BlackBerry Enterprise Server Resource Kit\BlackBerry AMT Tools>MDSPushvsPull.exe -p E -OL D:\test -L "E:\BlackBerry Enterprise Server\20120318"
where "E:\BlackBerry Enterprise Server\20120318" is log file location of BES.
The output is a *.cvs file with following columns:
 
Type Source Destination Date Time Port Size
Pull PIN i.huffpost.com 2/11/2012 11:48:17.176 EST 80 103
Pull PIN i.huffpost.com 2/11/2012 11:48:18.082 EST 80 93
Pull PIN i.huffpost.com 2/11/2012 11:48:19.348 EST 80 83
Pull PIN i.huffpost.com 2/11/2012 11:48:20.317 EST 80
88
 
Where Size in question is Bytes

Tuesday, March 27, 2012

Is it possible the following scenario - Physical server 2008 VHD backup file, created by wbadmin.exe to run in Hyper-V server?

Is it possible the following scenario - Physical server 2008 VHD backup file, created by wbadmin.exe to run in Hyper-V server?
 
One of our physical web servers is running Windows Server 2008 Standard x64, and is being backuped daily by default backup utility for server 2008 (wbadmin.exe).
I am curiuous is it possible to restore this VHD backup file into Hyper-V server (said in other way to create new VM using that VHD image).
If it's possible - what are the steps to successfully do this?
Nope, won't work.
But, this will:
- Prepare a fresh VM with the same OS.
- Shut down the VM and mount the VHD file on another VM
- Mount the "backup" VHD you'd like to restore from the same VM
- Use robocopy /purge /b /e /copyall to take all the data from the backup vhd to the new VHD
After this, shut down the VM, and you should be able to create a new VM using the destination VHD file. It will boot - all you have to do is install integration services.
Now for some more "magic":
You can use vshadow.exe to create a VSS snapshot of a running physical OR virtual machine and expose it to a drive letter (yes, boot drive also), and use the robocopy trick above to perform P2Vs or V2Vs. What's good about this method is that you can do a first pass with the machine still servicing requests, then stop all critical services and do another pass to complete the process. Typically takes about 2-3 minutes, depending on how much data has changed. Robocopy will only copy files which are different, and also copies NTFS permissions.
 
Note:
 
1) You may need to use DriverInjection (http://www.911cd.net/forums//index.php?showtopic=22523&st=0) or something similar if the standard IDE driver is not present on the source.
2) You may have to edit boot.ini to point to partition 1 - some system manufacturers have a utility partition as #1.
Otherwise you should be good to go.
 
References:
 
How to configure WSB with the support for Hyper-V VSS writer.