Wednesday, July 15, 2020

Elasticsearch error "All shards failed for phase: [query]"

Issue: Elasticsearch prints error message similar to the following (usually after an upgrade)


[2020-07-13T09:03:10,384][DEBUG][o.e.a.s.TransportSearchAction] [hostname] All shards failed for phase: [query]
org.elasticsearch.action.NoShardAvailableActionException: null
    at org.elasticsearch.action.search.AbstractSearchAsyncAction.start(AbstractSearchAsyncAction.java:115) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:154) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:53) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:173) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:145) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:87) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.client.node.NodeClient.executeLocally(NodeClient.java:75) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.client.node.NodeClient.doExecute(NodeClient.java:64) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:403) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.client.FilterClient.doExecute(FilterClient.java:67) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.client.ParentTaskAssigningClient.doExecute(ParentTaskAssigningClient.java:66) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:403) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.client.support.AbstractClient.search(AbstractClient.java:530) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.index.reindex.ClientScrollableHitSource.lambda$doStart$0(ClientScrollableHitSource.java:79) ~[?:?]
    at org.elasticsearch.index.reindex.ClientScrollableHitSource$1RetryHelper.doRun(ClientScrollableHitSource.java:144) ~[?:?]
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.index.reindex.ClientScrollableHitSource.searchWithRetry(ClientScrollableHitSource.java:176) ~[?:?]
    at org.elasticsearch.index.reindex.ClientScrollableHitSource.doStart(ClientScrollableHitSource.java:79) ~[?:?]
    at org.elasticsearch.index.reindex.ScrollableHitSource.start(ScrollableHitSource.java:69) ~[?:?]
    at org.elasticsearch.index.reindex.AbstractAsyncBulkByScrollAction.start(AbstractAsyncBulkByScrollAction.java:137) ~[?:?]
    at org.elasticsearch.index.reindex.TransportDeleteByQueryAction.doExecute(TransportDeleteByQueryAction.java:63) ~[?:?]
    at org.elasticsearch.index.reindex.TransportDeleteByQueryAction.doExecute(TransportDeleteByQueryAction.java:39) ~[?:?]
    at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:173) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:145) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:87) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.client.node.NodeClient.executeLocally(NodeClient.java:75) ~[elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.index.reindex.AbstractBaseReindexRestHandler.lambda$doPrepareRequest$0(AbstractBaseReindexRestHandler.java:69) ~[?:?]
    at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:82) [elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:162) [elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.http.HttpServer.dispatchRequest(HttpServer.java:115) [elasticsearch-5.2.2.jar:5.2.2]
    at org.elasticsearch.http.netty4.Netty4HttpServerTransport.dispatchRequest(Netty4HttpServerTransport.java:515) [transport-netty4-5.2.2.jar:5.2.2]
    at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:70) [transport-netty4-5.2.2.jar:5.2.2]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at org.elasticsearch.http.netty4.pipelining.HttpPipeliningHandler.channelRead(HttpPipeliningHandler.java:65) [transport-netty4-5.2.2.jar:5.2.2]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [netty-codec-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [netty-codec-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [netty-codec-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [netty-codec-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [netty-codec-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) [netty-codec-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:527) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:481) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441) [netty-transport-4.1.7.Final.jar:4.1.7.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [netty-common-4.1.7.Final.jar:4.1.7.Final]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]

If you check cluster settings using following command:

# curl -XGET 'http://localhost:9200/_cluster/settings?pretty'

Following settings are reported:
{
  "persistent" : {
    "cluster" : {
      "routing" : {
        "allocation" : {
          "enable" : "none"
        }
      }
    }
  },
  "transient" : { }
}

Cause: Within Elasticsearch cluster,  cluster.routing.allocation.enable it is set to "none".  As a result no shard allocations of any kind are allowed for any indices.

More details about these settings can be found at the following URL:
 https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html#cluster-shard-allocation-settings

Solution: If upgrade has been completed and you are ready to resume shard allocation 

# curl -XPUT localhost:9200/_cluster/settings -d '{
    "persistent" : {
        "cluster.routing.allocation.enable" : null
    }
}'



I hope you find it helpful - Rajan Katwal

Friday, April 13, 2018

Windows 10 - Random freeze while saving files or opening folders

Issue: While saving files on Windows 10 based systems it may take long time after save button is selected or while trying to navigate through folders.

Cause: "Show frequently use folders in Quick access" and "Show recently used folders in Quick access" are interfering with operations

Solution:

  1. Open File Explorer
  2. Select View
  3. Select Options
  4. Select "Change folder and search options"
  5. Uncheck "Show frequently use folders in Quick access" and "Show recently used folders in Quick access"  options
  6. Select Clear button
  7. Done
  8. Test

Monday, January 9, 2017

Windows 8.1 or Windows Server 2012 R2 - The update is not applicable to your computer

Issue: While installing updates for Windows 8.1 or Windows Server 2012 R2 error message may appear "The update is not applicable to your computer"

This issue occurs especially if you do not have KB2919355 installed and you want to install it to make sure you can install rest of the future updates.

Cause: March 2014 servicing stack update (KB2919442)  is missing.

Resolution: Download and install KB2919442 before installing rest of the updates.

Following is the link to download it



Monday, December 5, 2016

Microsoft Outlook 2010, 2013 and 2016 crashes after installing Microsoft Dynamics CRM 2016 SP1 Client for outlook- KB3154952

Issue: Microsoft Outlook 2010, 2013 and 2016 crashes after installing Microsoft Dynamics CRM 2016 SP1 - KB3154952  (on-premises)

Crashes becomes a lot  more aggressive when other add-ins (especially from 3rd party) are installed for outlook. If 3rd party addin gets disabled in outlook then number of Outlook crash will reduce. While working with one such add-in we were seen Outlook crash as soon as outlook would start.

Following are the example of events that will be recorded in application event logs:

Log Name:      Application
Source:        Application Error
Date:          5/12/2016 2:20:15 PM
Event ID:      1000
Task Category: Application Crashing Events
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      HOSTNAME
Description:
Faulting application name: OUTLOOK.EXE, version: 15.0.4875.1000, time stamp: 0x57fc97a0
Faulting module name: clr.dll, version: 4.6.1085.0, time stamp: 0x57a4fc7a
Exception code: 0x80131506
Fault offset: 0x002b5abd
Faulting process id: 0x224c
Faulting application start time: 0x01d24ea6752d3cbc
Faulting application path: C:\Program Files (x86)\Microsoft Office\Office15\OUTLOOK.EXE
Faulting module path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Report Id: bd2e0287-ba99-11e6-8ab6-e4a471647f11


Log Name:      Application
Source:        .NET Runtime
Date:          5/12/2016 2:17:32 PM
Event ID:      1023
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      HOSTNAME
Description:
Application: OUTLOOK.EXE

Framework Version: v4.0.30319

Description: The process was terminated due to an internal error in the .NET Runtime at IP 72BE5ABD (72930000) with exit code 80131506.



Cause: KB3154952 release version 08.01.0000.0359  that released in mid 2016 (close to July) had issue where Outlook will crash a lot more after Outlook Client for Microsoft Dynamics CRM 2016 would get upgraded to this release.

Solution: Microsoft seems to have re-published service pack for KB3154952 on 21st September 2016 under same version 08.01.0000.0359. However new set of downloads have newer version of Microsoft Dynamics CRM Outlook client 2016 version 08.1.0000.0371.


https://www.microsoft.com/en-us/download/details.aspx?id=52662



Basically when new setup files will be used, following that you should see version of Microsoft Dynamics CRM 2016 Outlook Client to be reported as 08.01.0000.0371 in program manager. 


Reference: Came across this page while looking for Microsoft articles that could explain why we say that difference in versions which seems to explain what others have also encountered/ 

https://community.dynamics.com/crm/f/117/t/207322

Monday, February 9, 2015

Microsoft Natural Ergonomic 4000 Keyboard does not work on Windows 7

Problem description: I bought this keyboard to give some rest to my wrists. To my surprise when I connected keyboard to USB port it didn't work. I tried following:

1. Uninstalled keyboard from device manager and scanned again. It finds the keyboard and even the model of keyboard but it is unable to install drivers. 
2. Installed Mouse and Keyboard Center 2.3 64bit and it didn't help.
3. Installed IntelliType 8.2 64bit for Windows 7 which didn't work either,
4. Connected KB to another desktop and it worked which had Ubuntu on it.
5. Connected to another windows desktop and it worked.
6. Checked Microsoft forums for this keyboard that was not of much help.
7. On same machine where it does not work in Windows, it works in bios and while selecting booting options.

By this time, it was established that issue is with the drivers on my particular desktop. Then started to look for forums that were  unrelated to this keyboard but in general keyboard drivers issue, found somewhere mentioned that MS update KB2529073.

CAUSE: Windows update KB2529073 may cause this issue.

Solution:

1. Connect another keyboard and log on to machine in question.
2. Remove Windows update KB2529073.
3. Shutdown PC.
4. Swap keyboard again with Microsoft Keyboard.
5. Start PS and wait for MS Windows to start, you will realise that green light above [1] button is on this time which wasn't turned on when issue existed. Your keyboard should be good to go. 


Thursday, November 27, 2014

Exchange 2013 and Exchange 2010 mixed environment throws error message "The arbitration mailbox 'SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}' for the organization '' is located on a server that doesn't have Exchange 2013 installed. The arbitration mailbox must be moved to an Exchange 2013 server before you can enable auditing."

Issue: While enabling auditing or trying to access audit info following warning message would appear:

The arbitration mailbox 'SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}' for the organization '' is
located on a server that doesn't have Exchange 2013  installed. The arbitration mailbox must be moved to an Exchange
2013 server before you can enable auditing.

Cause: As per Microsoft article http://technet.microsoft.com/en-us/library/dn249849(v=exchg.150).aspx , SystemMailbox mentioned above should be moved to  Exchange 2013 database once Exchange 2013 is introduced into the environment.

Resolution: Move 'SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}' mailbox from Exchange 2010 based mailbox DB to Exchange 2013 DB.

Steps:

1. Find out location of arbitration databases using following exchange powershell cmdlet:

Get-Mailbox -Arbitration | fl Name, Displayname, ServerName, Database, AdminDisplayVersion

It would print information similar to the following

Name                : SystemMailbox{1f05a927-c4a9-4cc7-80bd-a557eb562135}
DisplayName         : Microsoft Exchange Approval Assistant
ServerName          : exchange
Database            : Mailbox Database 0147642087
AdminDisplayVersion : Version 14.3 (Build 123.4)

Name                : SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}
DisplayName         : Microsoft Exchange
ServerName          : exchange
Database            : Mailbox Database 0147642087
AdminDisplayVersion : Version 14.3 (Build 123.4)

Name                : FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042
DisplayName         : Microsoft Exchange Approval Assistant
ServerName          : exchange
Database            : Mailbox Database 0147642087
AdminDisplayVersion : Version 14.3 (Build 123.4)

Name                : SystemMailbox{bb558c35-97f1-4cb9-8ff7-d53741dc928c}
DisplayName         : Microsoft Exchange
ServerName          : exchange2013
Database            : Mailbox Database 0562670298
AdminDisplayVersion : Version 15.0 (Build 995.29)

Name                : Migration.8f3e7716-2011-43e4-96b1-aba62d229136
DisplayName         : Microsoft Exchange Migration
ServerName          : exchange2013
Database            : Mailbox Database 0562670298
AdminDisplayVersion : Version 15.0 (Build 995.29)

2. Either use information from above to get database names where version is 15.0 or above or use following exchange powershell cmdlet to print information about all databases in your environment:

Get-MailboxDatabase -IncludePreExchange2013 | fl Name, Server, AdminDisplayVersion

It would print information similar to the following:

Name                : Mailbox Database 0147642087
Server              : EXCHANGE
AdminDisplayVersion : Version 14.3 (Build 123.4)

Name                : Mailbox Database 0562670298
Server              : EXCHANGE2013
AdminDisplayVersion : Version 15.0 (Build 995.29)

3. Now move SystemMailbox in question using EAC  (under migration) or using following shell cmdlet (modify  with DB name identified above for exchange 2013)

Get-Mailbox -Arbitration -Identity "SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}" | New-MoveRequest -TargetDatabase

Reference: http://technet.microsoft.com/en-us/library/dn249849(v=exchg.150).aspx



Wednesday, November 26, 2014

Microsoft Exchange Server 2013 upgrade to SP1 or RU5 or RU6 will fail with error message " The Windows component RSAT-Clustering-CmdInterface isn't installed on this computer and needs to be installed before Exchange Setup can begin."

Issue: While trying to upgrade Microsoft Exchange Server 2013 RTM or releases below SP1/RU5/RU6 that is installed on Windows 2012 Server to either SP1 or RU5 or RU6   error message "The Windows component RSAT-Clustering-CmdInterface isn't installed on this computer and needs to be installed before Exchange Setup can begin." may appear on the screen.

Following is the screenshot while performing silent upgrade


If you will check ExchangeSetup.log file located usually under C:\ExchangeSetupLogs\ folder you will find entries similar to the following:

[11/25/2014 05:04:26.0209] [1] Failed [Rule:RsatClusteringCmdInterfaceInstalled] [Message:The Windows component RSAT-Clustering-CmdInterface isn't installed on this computer and needs to be installed before Exchange Setup can begin.]


[11/25/2014 05:04:26.0490] [1] [REQUIRED] The Windows component RSAT-Clustering-CmdInterface isn't installed on this computer and needs to be installed before Exchange Setup can begin.

[11/25/2014 05:04:26.0490] [1] Help URL: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.RsatClusteringCmdInterfaceInstalled.aspx

The link mentioned above as of today while I am writing this note is not working.

Following is the screenshot from the log file in question:




Solution: Install the required module using the following Windows PowerShell command whiand restart setup.exe program to upgrade.

Install-WindowsFeature RSAT-Clustering-CmdInterface

Following is the screenshot (ignore warning about automatic updates since I like to control updates on my servers)



Note: For more information about this module please refer Microsoft documentation on "Failover Clustering module"







Monday, November 24, 2014

How to find list of attributes in PAS (partial attribute set)

Purpose: Sometimes we need to find out what attributes are there in the PAS list used by the Active Directory environment. Sometimes just to make sure there isn't an attribute that you need to exist on all Global Catalog servers for a product or query to work. 


Steps: Following PowerShell command can be run on Domain Controller in your environment to get Display Name of attributes in PAS.

Get-ADObject -SearchBase "cn=Schema,cn=Configuration,dc=YourDomain,dc=com" -LDAPFilter "(isMemberOfPartialAttributeSet=TRUE)" -Properties lDAPDisplayName | Select lDAPDisplayName

Example : 

Get-ADObject -SearchBase "cn=Schema,cn=Configuration,dc=katwal,dc=local" -LDAPFilter "(isMemberOfPartialAttributeSet=TRUE)" -Properties lDAPDisplayName | Select lDAPDisplayName
Following PowerShell can be executed on the Domain Controller to get list of attributes 




Friday, August 15, 2014

USB Hard Disk or storage drive cannot be recognised by WINDOWS ?

Issue: At times Windows 7 may not be able to recognize a hard disk or a USB stick e.g. Sandisk Cruzer Slice and same device would work just fine on another Windows 7 machine ? 

In such case following is a solution that worked for me every time.

Cause: System may be missing some entries in usbstor.inf or file could be missing all together.

Resolution: To resolve this issue perform the following steps:

1. Get copy of USBstore.inf located under %windir%\inf\ folder from machine where the same device worked (make sure operating system is same e.g. Windows 7). You can email the same as well by renaming it to .txt file and then changing it to .inf on time of adding it to your machine.

2. On your machine where you have issue go to %windir%\inf\  folder (usually %windir% c:\Windows) and copy the file that you got from another machine where things worked as expected.

3. Launch device manager, you can do this by selecting  Start,   Run, in Open box type devmgmt.msc and select OK button. 

4. In Windows Device Manager look for Other Devices or Unknown Devices section, you will find your device marked with a yellow sign. Right click on your device and select Uninstall.

5. Stay within Device Manager, select Action menu on the top and select Scan for hardware changes.

6. Once scan finished you should see your device appearing properly.

How to allow certain types of file attachments (HTML/XML) through OWA (2010/2013)

GOAL: At times there may be sites that have business case to allow file attachments e.g. .HTML or .XML to be opened/accessed through OWA. Though these are be default not allowed to be opened due to security concerns but there may be sites where it is business requirement. 

STEPS:

From early days of Exchange 2003/2007 there were means available to allow such attachments through OWA. I am only adding here for very recent versions of the exchange only. Especially because they have Microsoft Exchange powrshell cmdlets which can do it very quickly. 

1. Open Microsoft Exchange Management Shell in case of Exchange 2010/2013 

2. Once shell is connected up and running use the following cmdlet to add extension to the AllowedFileTypes 

Set-OwaVirtualDirectory -identity "owa (default web site)" -AllowedFileTypes @{Add='.html'}

This would add .html to AllowedFileList for both "Plublic Computer File Access" and "Private Computer File Access".

In case you are working with an attachment time that is in the BlockedFileTypes or ForceSaveFileTypes list you need to remove those from there first.

After this change now will be up to the internet browser you are using.

For IE 8 it will work like a charm. Users will be able to OPEN and SAVE .HTML attachments as they they like.

With IE 9 and onward there is an issue, it would not allow HTML files to open and same is currently applicable to FireFox (on the time when I am writing it). Another issue is that if you click on SAVE button that will change any URLs within HTML with something like redir.aspx?........

Workaround for this issue is to add .HTML to ForceSaveFileTypes list and then use "Save Target As..." option within IE 9, 10 and 11.

Chrome appears to have no issue at this stage.

To me it appears this is combination of filtering within exchange and the way headers are passed on to browsers. IE 8 and Chrome can handle it but IE 9, 10, 11 and FireFox is having issue.





Thursday, July 17, 2014

COMMAND LINES WITH COMMON USE OF FOR LOOP

SOME COMMONLY USED COMMAND LINES ESPECIALLY FOR LOOPS

1.  Create file listing of all files or specific files (bare file names with path) from all subdirectories. It can be used to get listing of all such files on a drive letter.
        ALL FILES EXAMPLE:
DIR /S/B/A-D >> C:\Temp\XLSFILES.TXT

ONLY .XLS FILES EXAMPLE:
DIR /S/B/A-D | FIND /I "*.xls" >> C:\Temp\XLSFILES.TXT


2. Read one text file for path/location of the files and then move those files to a folder. This may be suitable when you have files scattered all  over the place in multiple sub-directories and you only need to move/copy certain files to certain location

    COPY OPERATION EXAMPLE:
    for /f "delims=########" %a in (C:\Temp\XLSFILES.TXT) do copy /Y "%a" I:\DestFolder

    MOVE OPERATION EXAMPLE:
    for /f "delims=########" %a in (C:\Temp\XLSFILES.TXT) do move /Y "%a" I:\DestFolder

3. List file name with path along with its size.
 
   ALL FILES WITHIN A SPECIFIC FOLDER EXAMPLE:
 
   for %F in ("c:\Users\Rajan\*") do @echo %F ------ %~zF

4. Combine logic to create a file listing of multiple file from different sub-directories and then get size of each file.

FILE NAMES AND SIZE USING COMMAND LINE EXAMPLE:
DIR /S/B/A-D >> E:\FileName.txt

for /f "delims=########" %F in (FileName.txt) do @echo %F ------ %~zF 
 
(assumed that user is running second command line from E:\> prompt)

4. If you have large number of text file(s) and you are only interested in certain line (containing specific words) from text file
   (a) Assume you have all your .txt files that are the input test file located in Files folder.
   (b) Create FindText.bat file and add following to it
@echo off
>results.txt (
FOR /F "delims=" %%i IN (TextFind.txt) DO (
FIND "%%i" files\*.txt | FINDSTR /v "^---- ^$"
)
)

Note: This example assumed that command prompt is already pointing to location where the BAT file is located and TextFind.txt is the file containing text that you will be searching for all *.txt files within Files folder.

Wednesday, July 16, 2014

Microsoft Windows NLB - Configure Exchange CAS high availability

Although for sites with high volume of network traffic coming to the CAS servers it is recommended to have hardware NLB, for sites that are small in size or do not have hardware NLB in hand Microsoft provides Windows Network Load Balancing as an option.

What I am going to mention below is something I built for my lab running Exchange 2013. You may want to check Microsoft best practices for your version of exchange before you follow this post. 

Legal Stuff: I or anyone related to me would not be responsible for any issue or loss caused if you follow this post.

Prerequisites: 

1. Server names used for CAS Servers e.g. CAS1.katwal.local and CAS2.katwal.local
2. Make sure both CAS servers has TWO NIC cards (network interfaces). 
3. Write down IP addresses of the both CAS servers:
     CAS1.katwal.local = 10.0.0.10/255.0.0.0
     CAS2.katwal.local = 10.0.0.11/255.0.0.0
4. Dedicated IP address for NLB : 10.0.0.50/255.0.0.0
5. NLB/CAS URL name: mail.katwal.local  (I assume you already prepared your CAS servers for this alias e.g. SSL certificates are already having autodiscover.katwal.local and mail.katwal.local in their SAN and certificates are already installed on each CAS server)
6. Rename network interfaces that we are going to use on both CAS servers for NLB (to NLB) to make sure we can differentiate them.

Prepration of network interfaces for NLB configuration:

1. As I mentioned above change the network interfaces names to make sure we can differentiate them. In my case I renamed them to NLB.

2. On both servers assign the IP addresses as mentioned above and subnet mask. Make sure you DO NOT fill any DNS information or WINS information.

3. By going to ADVANCED TCP/IP settings screen, under DNS tab uncheck "Register this connection's addresses in DNS" on both servers. Similarly under WINS tab select "Disable NetBIOS over TCP/IP"






4. Check Network Adapter bindings on both machines to make sure NLB adapters are the first adapters in binding. I will give example from Windows 2008 R2 machine below:
  • Open NETWORK CONNECTIONS folder.
  • Press ALT key to bring up the menu bar, go to ADVANCED menu
  • Select Advanced Settings
  • Under Adapters and Binding section, reorder positions of NIC interfaces to make sure NLB is the first interface and other network interface is second.

INSTALL AND CREATE NLB CLUSTER:
By default Network Load Balancing feature is not installed on the servers. Following are the steps to install and configure a NLB cluster:

1. Select START > Administrative Tools> Server Manager

2. Select Features > Add Features,  Select Network Load Balancing Manager, Select Install

3. Close Wizard when Network Load Balancing Manager is installed.

4. On CAS1 server select START > Administrative Tools > Network Load Balancing Manager

5. When NLB Console will start, right click on Network Load Balancing Cluster and select New Cluster.

6. On New Cluster: Connect screen, type FQDN for CAS1 server e.g. CAS1.katwal.local  and select Connect.

7. Select Network Interface with IP 10.0.0.10 and select Next button.

8. On  New Cluster:Host Parameters windows select all default and select Next.

9. On New Cluster: Cluster IP addresses window select ADD button and add IPv4 IP address of NLB cluster which is 10.0.0.50 with subnet mask of 255.0.0.0, select OK, select NEXT

10. On New Cluster: Cluster Parameters window under Full Internet Name section type the URL name selected above: mail.katwal.local 

11. Leave Cluster Operation Mode to be set to Unicast and select NEXT.

12. On Add/Edit Port Rule window, select Finish.

13. Allow some time for cluster to converge and turn into green colour icon.

14. Now log on to CAS2 server and use PING command to check if mail.katwal.local replies back on IP address that was assigned to NLB (10.0.0.50).

15. Just in case there is some issue with getting the reply back, check DNS Server configuration.

16. To add CAS2 server to the NLB Cluster open NLB Manager Console

17. Right Click on the cluster (mail.katwal.local) and select  Add Host To Cluster.

18. In Host Field type FQDN for CAS2 server (CAS2.katwal.local) and select Connect.

19. Select NLB interface with IP address of 10.0.0.11 and select Next, Next.

20. Leave everything to default as we did earlier and select Finish.

21. Now you should see second node of CAS2 will start to converge just as CAS1 did earlier and you should see it with the green icon.

22. Verify that when one of the nodes is turned off from NLB Manager we can still get reply for URL (mail.katwal.local) from IP address 10.0.0.50. Additional test will be to turn of both nodes from NLB manager and check if we cannot get to mail.katwal.local and then start only one node at a time.  

23. If using virtual machines you may want to have static MAC address that was provided when cluster was configured. You can get to it by using NLB manager and get to to the properties of Cluster and selecting Cluster Parameter tab. Once you have the MAC address if you are using VMWARE you can go to the properties of NIC we used for NLB and add the MAC address for making it static. Similarly in Hyper-V Manager configure NIC used for NLB and fill  in info under Static section. on Hyper-V also select Enable Spoofing of MAC Addresses.

24. To confirm changes to NIC have not broken anything restart both nodes one at a time and confirm that both nodes converge without issues.

25. Next step is to make sure NIC forwarding is done so that all OWA requests only go to NIC selected for NLB. Following is example of the command I ran on both of my CAS servers. 

netsh interface ipv4 set interface NLB forwarding=enabled

Make sure you start command prompt using Run As Administrator. Reply expected after running above command line is OK.

26. Now you can go ahead and start with Exchange Server 2013 Servers control panel (ECP) to define Internal and external URLs as you want those.

Tuesday, July 8, 2014

Exchange 2013 - Test-OutlookWebServices to verify four services functionality

Problem Description: At times we need to check if any of the following is having an issue

AUTODISCOVER
EXCHANGE WEB SERVICES
AVAILABILITY SERVICE
OFFLINE ADDRESS BOOK

Those who are familiar with old version of Test-OutlookWebServices might have to watch for few changes in Exchange 2013.

Resolution:

1. By default user can run Test-OutlookWebServices. If you get error message similar to the following that means a user mailbox/test mailbox is not provided.

[PS] C:\Windows\system32>Test-OutlookWebServices Unable to find the client accesss monitoring user. Please run C:\Program Files\Microsoft\Exchange Server\V15\Scripts\New-TestCasConnectivityUser.ps1. Exception: Microsoft.Exchange.Monitoring.MailboxNotFoundException: Failed to find the mailbox. Mailbox = 'extest_1d3bbbbcd5f34@katwal.local'. at Microsoft.Exchange.Monitoring.CommonTestTasks.GetDefaultTestAccount(ClientAccessContext context) at Microsoft.Exchange.Monitoring.TestWebServicesTaskBase.GetMonitoringAccount()    
+ CategoryInfo : InvalidData: (:) [Test-OutlookWebServices], TestWebServicesTaskException    
+ FullyQualifiedErrorId : 5322965D,Microsoft.Exchange.Monitoring.TestOutlookWebServicesTask    
+ PSComputerName : exchange2013.katwal.local

 You can create a test user using the PS script mentioned in the error message above. Following are steps:
[PS] C:\Windows\system32>cd $exscripts
[PS] C:\Program Files\Microsoft\Exchange Server\V15\scripts>.\new-TestCasConnectivityUser.ps1

Please enter a temporary secure password for creating test users. For security purposes, the password will be changed regularly and automatically by the system.

Enter password: ***********

Create test user on: EXCHANGE2013.katwal.local
Click CTRL+Break to quit or click Enter to continue.:

UserPrincipalName: extest_1d3bbbbcd5f34@katwal.local WARNING: The command completed successfully but no settings of 'katwal.local/Users/extest_1d3bbbbcd5f34' have been modified.

You can enable the test user for Unified Messaging by running this command with the following optional parameters : [-UM DialPlan -UMExtension ] . Either None or Both must be present.

[PS] C:\Program Files\Microsoft\Exchange Server\V15\scripts>


Now when we will run the Test-OutlookWebServices we should run without issues.


2. Another method is to specify a particular mailbox. Following is an example:

[PS]C:\Windows\System32>Test-OutlookWebServices -identity:rajan@katwal.local -MailboxCredential (Get-Credential)



Friday, April 25, 2014

Exchange 2013 setup on Domain Controller throws error message "Unable to set shared config DC"

PROBLEM DESCRIPTION: While installing Microsoft Exchange 2013 on a server that is also a Windows Domain Controller, Transport Service installation will fail with the following error message:

Error:
The following error was generated when "$error.Clear(); 
          $maxWait = New-TimeSpan -Minutes 8
          $timeout = Get-Date;
          $timeout = $timeout.Add($maxWait);
          $currTime = Get-Date;
          $successfullySetConfigDC = $false;

          while($currTime -le $timeout)
          {
            $setSharedCDCErrors = @();
            try
            {
              Set-SharedConfigDC -DomainController $RoleDomainController -ErrorVariable setSharedCDCErrors -ErrorAction SilentlyContinue;
              $successfullySetConfigDC = ($setSharedCDCErrors.Count -eq 0);

              if($successfullySetConfigDC)
              {
                break;
              }
              Write-ExchangeSetupLog -Info ("An error ocurred while setting shared config DC. Error: " + $setSharedCDCErrors[0]);
            }
            catch
            {
              Write-ExchangeSetupLog -Info ("An exception ocurred while setting shared config DC. Exception: " + $_.Exception.Message);
            }

            Write-ExchangeSetupLog -Info ("Waiting 30 seconds before attempting again.");
            Start-Sleep -Seconds 30;
            $currTime = Get-Date;
          }

          if( -not $successfullySetConfigDC)
          {
            Write-ExchangeSetupLog -Error "Unable to set shared config DC.";
          }
        " was run: "Unable to set shared config DC.".


CAUSE: Server has IPv6 turned off. 

SOLUTION: 

1. Turn back on IPv6 for the network adapter.
2. Restart the server
3. Start again the Microsoft Exchange 2013 setup, it will find that last installation was incomplete and will complete it.
4. Check to make sure all services for exchange are operational and all configurations.

Usually recommendation is not to install Exchange on Domain Controllers. Some might have to do this due to lack of resources or just because they need to do something for a presentation, demo or testing. 

Monday, November 11, 2013

Some LDAP queries for common use

LDAP QUERIES

AD/GC FOR GROUPS THAT A USER IS MEMBER OF

1. Find the DN of the user e.g.
CN=Rajan Katwal,CN=Users,DC=katwal,DC=local

2.Use the DN into following query
(&(objectCategory=group)(member=CN=Rajan Katwal,CN=Users,DC=katwal,DC=local))

------------------------------------------------------------------------------------------------

USERS MEMBER OF A SPCIFIC GROUP

(&(objectcategory=user)(memberof=CN=Katwal_DL,CN=Users,DC=katwal,DC=local))

------------------------------------------------------------------------------------------------

USERS WITH SPECIFIC DISPLAY NAME

(&(objectclass=Person)(displayName= Rajan*))

------------------------------------------------------------------------------------------------

ALL ACTIVE (Non-Disabled) users from AD

(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2))

------------------------------------------------------------------------------------------------
GET all user of a group but will exclude user with display name starting with "user"

(&((objectclass=user)(memberOf=cn=Group1,ou=ouOfGroup,dc=subdomain,dc=domain,dc=com))(!(|((displayname=user*)))))



Tuesday, July 16, 2013

Exchange 2013 prereq using command line

Following is the command to install most of the prerequisites before installing Microsoft Exchange 2013

WINDOWS SERVER 2012
=====================
(POWERSHELL)

Import-Module ServerManager
 
Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http- Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation

WINDOWS SERVER 2008 R2 (SP1)
==========================

Import-Module ServerManager

Add-WindowsFeature Desktop-Experience, NET-Framework, NET-HTTP-Activation, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Web-Server, WAS-Process-Model, Web-Asp-Net, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI

Thursday, June 20, 2013

Microsoft Office Communication 2007 R2 (3.5.6907.268) crash especially when someone send IM using a message from MS Outlook

Problem Description: Microsoft Office Communication 2007 R2 (3.5.6907.268) crash especially when someone send IM using a message from MS Outlook. This happened to be few times after some windows updates couple of weeks back. Following will be reported in the Application Event log

Log Name:      Application
Source:        Application Error
Date:          19/06/2013 2:50:02 PM
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      LabMachine
Description:
Faulting application name: communicator.exe, version: 3.5.6907.268, time stamp: 0x5165ca9a
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x0a7cb6d8
Faulting process id: 0x238c
Faulting application start time: 0x01ce6bf22ea6ba94
Faulting application path: C:\Program Files (x86)\Microsoft Office Communicator\communicator.exe
Faulting module path: unknown
Report Id: b374a2ee-d89b-11e2-af3a-005056c00008


This issue would mostly occur when you will be having a conversation with someone, close the window and that person later on decides to reply to you in the same window.
 
Cause: Unknown, even though it looked like the serialization issue that was fixed by MS long back.

Solution: Earlier I tried  Security Update for Microsoft Communicator 2007 R2 (KB2827753), I didn't notice this issue but it started to occur again.

Later on it got really worse and workaround was to leave all IM windows open.
 
Final fix so far is to :
 
Remove MS Communicator, install it back again and patch it with following:
 
 
NOTE: Not being on latest security patch opens up security hole. You want to make sure you work with Microsoft on this issue if you continue to face this issue.

Thursday, June 6, 2013

Files mfc100u.dll or msvcr100.dll are missing from your computer

PROBLEM DESCRIPTION: Some time while running some random programs users may see a pop-up with error message "The program cannot start because mfc100u.dll is missing from your computer."

CAUSE: Program throwing the pop-up with error message is dependent on "Microsoft Visual C++ 2010 SP1 Redistributable Package".

RESOLUTION: Depending upon the version of the OS used you may need one of the two versions of Microsoft Visual C++ 2010 SP1 Redistributable Package. Following are the locations for each package:


Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)
http://www.microsoft.com/en-au/download/details.aspx?id=8328

Microsoft Visual C++ 2010 SP1 Redistributable Package (x64)
http://www.microsoft.com/en-au/download/details.aspx?id=13523


The same packages may also fix the issue is errors similar to the following are thrown:

This application has failed to start because MSVCR100.dll was not found. Re-installing the application may fix this problem
 

Tuesday, May 7, 2013

Seeing a lot of duplication in journaling mailboxes while using standard MS Exchange Journaling?

Are you seeing duplicates in MS Exchange Journal mailboxes ?
Are you using standard journaling on Exchange 2007 or Exchange 2010 ?
Mostly seeing duplicate when emails are sent to large distribution lists ?

If answers to above mentioned questions is 'YES' then there are chances it is working as designed even though when reading some MS Articles about Journaling and transport journaling might confuse you a little. I am not trying to argue with MS articles (http://technet.microsoft.com/en-us/library/bb738122(v=EXCHG.80).aspx) , I am just trying to explain how that can be broken down for understanding:

There are two scenarios where you see duplication:

1. Sites with 1 Journal Mailbox: In this case you will see that when an email is sent to distribution list especially if that distribution list contained thousands of users then you will see approximately journaling mailbox having bifurcated copies that will be using formula of

Number of recipients/1000

This is because by default in Exchange 2010 and Exchange 2007 within EdgeTransport.exe.config file variable "ExpansionSizeLimit" is set to 1000. There is no garuntee through each bifurcated copy will have exact 1000 recipients information in its envalope. Sometimes you will see nine hundred something and sometimes it would few more than 1000.

Now when an email is sent to a distribution group and only one journal mailbox is configured in your environment you will see multiple copies of the message. What happens if that due to above setting in place, to make routing/delivery quicker message is broken into multiple copies by explanding the distribution list. The tests have I have apprears to suggest that breakdown is sorted alphabatically. MessageID for every single copy in journaling mailbox will be same, just the recipient information on the envalope will be different.

Above mentioned setting can be changed BUT with caution as it can impact your system if it is in production. Reffer to above mentioned article for more information.

2. Sites with more than 1 journal mailbox: This scenario gets a little more tricky. In this scenario you might even see that not only journaling mailbox that is responsible for journaling from DB where sender is location had journaled multiple copies but other journaling mailboxes also has multiple copies. If you have distribution groups with many thousand users and many journal mailboxes to spead the load of journaling you might see a lot more duplicates. Here is how I have put it in my tick skull:

(a) When a sender sends the email to the distibution list (DL) with large number of users. The journal mailbox responsible for journaling DB where sender's mailbox is located will bifurcate message to many messages in the journaling mailbox where it is journaling. Now to this point we are all good as mentioned above.
 
(b) Now if we go and check other journal mailboxes we may find similar if not exact number of messages sitting in it. The reason is that there are other mailbox DBs that are journaling to other journaling mailboxes. Usually they are only meant to have bifurcated copies of the messages that had users belonging to mailbox DBs in question within the envelop of the message. What happens is that many a times we do not divide users based on their names while assigning them mailbox DBs. Especially for a company with global presence exchange servers could be country specific or region specific. Now when first transport server would have created the bifurcated messages all other servers would have got all the copies due to one or more user being present in the envaople of the each bifurcated message. For testing in house I did the following which might explain what happened:

- CREATED USERS ON MULIPLE DBs

TEST_User1 - EXCHANGE\First Storage Group\Mailbox Database
TEST_User2 - EXCHANGE\First Storage Group\Mailbox Database
TEST_User3 - EXCHANGE\First Storage Group\Mailbox Database
TEST_User4 - EXCHANGE\Third Storage Group\Mailbox Database
TEST_User5 - EXCHANGE\Third Storage Group\Mailbox Database
TEST_User6 - EXCHANGE\Third Storage Group\Mailbox Database
TEST_User7 - EXCHANGE2\First Storage Group\Mailbox Database
TEST_User8 - EXCHANGE2\First Storage Group\Mailbox Database
TEST_User9 - EXCHANGE2\First Storage Group\Mailbox Database
TEST_User10 - EXCHANGE2\First Storage Group\Mailbox DB2
TEST_User11 - EXCHANGE2\First Storage Group\Mailbox DB2

EXCHANGE\First Storage Group\Mailbox Database   - Journal_01_2007
EXCHANGE\Third Storage Group\Mailbox Database   - Journal_02_2007
EXCHANGE2\First Storage Group\Mailbox Database  - Journal_03_2007
EXCHANGE2\First Storage Group\Mailbox DB2       - Journal_04_2007

TEST ALL - Distribution Group with all 11 users created above.

Set value of ExpansionSizeLimit to 2 and restarted Transport Service on both Exchange servers

Test CASE 1 - Sent an email from KATWAL_Service account to itself in To and "TEST ALL" in BCC

Following are the number of messages found in journal mailboxes
Journal_01_2007 = 7 messages
Journal_02_2007 = 2 messages
Journal_03_2007 = 2 messages
Journal_04_2007 = 2 messages

Breakdown of recipients on the envalipes per journal mailbox

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Journal_01_2007 = 7 messages

MSG1
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_User11@katwal.local, Expanded: TESTALL@katwal.local

MSG2
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_user10@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_User9@katwal.local, Expanded: TESTALL@katwal.local

MSG3
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_User8@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_User7@katwal.local, Expanded: TESTALL@katwal.local

MSG4
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_User6@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_user5@katwal.local, Expanded: TESTALL@katwal.local

MSG5
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_User4@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_User3@katwal.local, Expanded: TESTALL@katwal.local

MSG6
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_user2@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_User1@katwal.local, Expanded: TESTALL@katwal.local

MSG7
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
To: Katwal_service@katwal.local
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Journal_02_2007 = 2 messages

MSG1
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_User6@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_user5@katwal.local, Expanded: TESTALL@katwal.local

MSG2
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_User4@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_User3@katwal.local, Expanded: TESTALL@katwal.local
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Journal_03_2007 = 2 messages

MSG1
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_user10@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_User9@katwal.local, Expanded: TESTALL@katwal.local

MSG2
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_User8@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_User7@katwal.local, Expanded: TESTALL@katwal.local
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Journal_04_2007 = 2 messages

MSG1
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_User11@katwal.local, Expanded: TESTALL@katwal.local

MSG2
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434D@EXCHANGE.katwal.local>
Bcc: TEST_user10@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_User9@katwal.local, Expanded: TESTALL@katwal.local
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


=====================================================================================
TEST CASE 2 - We configure all DBs on each exchange server to journal to only one journal mailbox. That way we have One journal mailbox per server.

Configured Journaling in the following manner

EXCHANGE\First Storage Group\Mailbox Database   - Journal_02_2007
EXCHANGE\Third Storage Group\Mailbox Database   - Journal_02_2007
EXCHANGE2\First Storage Group\Mailbox Database  - Journal_04_2007
EXCHANGE2\First Storage Group\Mailbox DB2       - Journal_04_2007

- Tested that changes made took place in exchange
- ExpansionSizeLimit is still set to 2
- Sent email to TEST ALL in BCC and Katwal_Service in TO list

Journal_02_2007 = 7 messages
Journal_04_2007 = 3 messages

- 7 messages breakdown is similar to what we found earlier.
- Breakdown of 3 messages in Journal_04_2007 are as follows.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Journal_04_2007 = 3 messages (from bottom to top)
MSG1
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434F@EXCHANGE.katwal.local>
Bcc: TEST_User8@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_User7@katwal.local, Expanded: TESTALL@katwal.local

MSG2
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434F@EXCHANGE.katwal.local>
Bcc: TEST_user10@katwal.local, Expanded: TESTALL@katwal.local
Bcc: TEST_User9@katwal.local, Expanded: TESTALL@katwal.local

MSG3
Message-Id: <D91E43950FB2744E94C5A4E6C78E815606857157434F@EXCHANGE.katwal.local>
Bcc: TEST_User11@katwal.local, Expanded: TESTALL@katwal.local
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

=====================================================================================

TEST CASE 3 - To confirm what we found in the testing above is true; we configured all DBs to journal into Journal_04_2007

EXCHANGE\First Storage Group\Mailbox Database   - Journal_04_2007
EXCHANGE\Third Storage Group\Mailbox Database   - Journal_04_2007
EXCHANGE2\First Storage Group\Mailbox Database  - Journal_04_2007
EXCHANGE2\First Storage Group\Mailbox DB2       - Journal_04_2007

- There were only 7 messages in the Journal_04_2007 which were created the same way in above test cases.


In my testing number of mailboxes were very small leading to small number of bifurcated messages. Number of bifurcated messages will depend on configuration usesed at your site.

(NOTE: I hope others will find it useful. All above mentioned content is based on my understaning and testing performed. If you see any issues in your environment you may want to consult software vendor of yours.)


 

MS SQL - Cannot Connect to DataBase; Cannot open user database. Login Failed. Login failed for user 'userName'. (Microsoft SQL server, Error 4064)

Problem Description: After droping a database (DB) without checking if that DB was the default DB of the account used, once will find they cannot log back into the SQL Studio to connect to SQL server. Pop-up with information similar to the following will appear:

Cannot Connect to DataBase; Cannot open user database. Login Failed. Login failed for user 'userName'.  (Microsoft SQL server, Error 4064)

Cause: Accidently DB that was droped was used as default DB for the account used.

Solution: SQLCMD can be used to connect to master or tempDb and then ALTER Default_Login DB for the user. Following is an example:

C:\> SQLCMD -E -D master
1> alter login [Domain\ServiceAccount] with default_database=master
2> GO
3> exit

C:\>

This should allow the connection back to the SQL Server.

Note: Same action can me performed by SQL Studio configuration. I will update that later on with screenshots.