If you are like me and eagerly deployed Exchange 2016 Preview in your 2013 lab (before official support was available) then you will likely have encountered this error when you upgraded to CU 10 and beyond.
[ERROR] The given key was not present in the dictionary.
If we review the Exchange setup log let’s see the last thing the installer was working on.
[2] Used domain controller DC.SKARO.LOCAL to read object CN=My Custom Apps,CN=Roles,CN=RBAC,CN=SKARO,CN=Microsoft Exchange,CN=Sevices,CN=Configuration,DC=SKARO,DC=LOCAL. [2] Used domain controller DC.SKARO.LOCAL to write object CN=My Custom Apps,CN=Roles,CN=RBAC,CN=SKARO,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=SKARO,DC=LOCAL. [2] Saving object "My Custom Apps" of type "ExchangeRole" and state "Unchanged". [2] Used domain controller DC.SKARO.LOCAL to read object CN=My Marketplace Apps,CN=Roles,CN=RBAC,CN=SKARO,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=SKARO,DC=LOCAL. [2] Used domain controller DC.SKARO.LOCAL to write object CN=My Marketplace Apps,CN=Roles,CN=RBAC,CN=SKARO,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=SKARO,DC=LOCAL. [2] Saving object "My Marketplace Apps" of type "ExchangeRole" and state "Unchanged". [2] Used domain controller DC.SKARO.LOCAL to read object CN=My ReadWriteMailbox Apps,CN=Roles,CN=RBAC,CN=SKARO,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=SKARO,DC=LOCAL. [ERROR] The given key was not present in the dictionary. [WARNING] An unexpected error has occurred and a Watson dump is being generated: The given key was not present in the dictionary. [1] The following 1 error(s) occurred during task execution: [1] 0. ErrorRecord: The given key was not present in the dictionary. [1] 0. ErrorRecord: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
I have color-coded the setup log to help illustrate the process. During the organization preparation, Exchange is making changes to the RBAC roles. This is where it is failing.
In blue, it reads in each RBAC role from our DC named dc.skaro.local.
In green, it specifies which DC it will use to write any changes.
In orange, it identifies what, if any, changes were made.
We can see it successfully completes its configuration on the “My Custom Apps” and “My Marketplace Apps” user roles. Yet the error occurs immediately after reading in “My ReadWrite Mailbox Apps”.
Something is preventing the Exchange 2013 setup from reading this role from Active Directory. Let’s check it out in ADSI Edit. The setup log gives us a direct path to the object.
CN=My ReadWriteMailbox Apps,CN=Roles,CN=RBAC,CN=SKARO,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=SKARO,DC=LOCAL.
CAUTION: ADSI Edit is a LDAP editor. Be very careful when making changes with this tool. Be sure to have a working backup of Active Directory and regression plan before making changes here.
Fixing ‘The given key was not present in the dictionary’
Open ADSI Edit and select Configuration from the Naming Context dropdown. Click Ok.
Expand Configuration.
Expand ‘CN=Configuration,DC=<your domain>,DC=<your domain>’.
Expand Services.
Expand Microsoft Exchange.
Expand <your exchange organization name>.
Expand RBAC.
Expand Roles.
If we scroll down we can see that ‘CN=My ReadWriteMailbox Apps’ exists. Right-click and open the Properties of this object.
The attribute in question is msExchRoleType. It has a value of 132. If we compare this against an environment that does not have 2016 introduced the value is 115. Let’s change this back.
Double click the msExchRoleType attribute and enter a value of 115. Click Ok.
Click Ok and close ADSI Edit.
You are all set!
At this point, you should be able to successfully complete the CU 10 (or later) update with Exchange 2016 Preview in your lab environment.
Join the conversation on Twitter @SuperTekBoy.
Reference: Thomas Pedersen
Leave a Reply