Tuesday, October 20, 2015

Upgrading Dirsync to Azure Active Directory Connect (AADC) a cautionary tale

I usually try to be pretty thorough about things when I post.  I wasn't planning on posting a here's how you upgrade post so I have no screen shots or errors. Basically the upgrade is next next next.  The one problem that I had was that I needed to change the schedule for the sync process.  This is now a scheduled task that is automagically setup in AADC.

When you change the schedule DO NOT JUST CHANGE THE PASSWORD ON THE CREATED SERVICE ACCOUNT.  Make a new service account, or use another account to edit the scheduled task and run it.  If you want to change the password on the created service account it will mess up the encryption keys in AADC and you will have to jump through some hoops.  It is not a huge deal, but it takes way way less time to just make or use another account to run the task.  Just save yourself some time.

Tuesday, October 13, 2015

Forced reboots from WSUS

So lets say that you are oh I don't know upgrading Dirsync to the new hotness.  You do your research and everyone says it's just next next next and then happiness.  You don't even have to install any prereqs it will do that all for you.  (I'm looking at you https://azure.microsoft.com/en-us/documentation/articles/active-directory-aadconnect-dirsync-upgrade-get-started/)  Well you have to update powershell and .NET.  You do that and reboot a couple times and then start the new Azure Active Directory Connect install.  It just all works.

Until you're in the middle of a full sync process and WSUS says hey you have new software that needs patches!  Reboot now!  I don't care what database operations you are doing that I am going to mess up!  BOW TO MY EVERY WHIM!

So I Google blocking reboots due to an update and every single suggestion I find says change this and reboot and you're golden.  What part of blocking a reboot do you not understand here people?

So I rush to download Process Explorer onto my machine.  I do the process find over the WSUS I'M GOING TO DESTROY YOU popup (I think it might actually say something like your machine is going to reboot in X time would you like to reboot now).  I right click that and go to the Threads tab and Suspend each thread.  That appears to have saved my hour of database operations from being interrupted.  I'll go in and unsuspend all that after my full sync is done and then let the server reboot for updates ON MY SCHEDULE.

Thursday, October 8, 2015

Installing Exchange 2013 (Something Went Wrong)

I'm not going to go into grand detail today.  Just a few quick notes on installing Exchange 2013 for the first time.  I have 2010 already in my org.

1) You can just install from the latest CU rollup.  I installed directly from 2013 CU9.

2) Install your first server as enterprise admin even if you have previously done the AD prep steps.  The first install of a 2013 server likes to create a user in root domain of your forest.  My Exchange servers live in a child domain and I got access denied when doing some user actions for the SystemMailbox.

3) When you go to access the ECP page you pretty much have to add ?ExchClientVer=15 at the end of the URL to get to see the ECP (https://mail.contoso.com/ecp/?ExchClientVer=15).  If not it just redirects you to a something went wrong page.  This appears to be because of the bug in the installer below.

4) Apparently there is a bug in some of the later CU installation processes.  After finalizing the install of 2013 and setting up the virtual directories I migrated a mailbox.  That mailbox was completely inaccessible. Outlook couldn't open it saying a folder was unavailable and OWA just gave the something went wrong error.  I was not able to even access https://server.contoso.com/autodiscover/autodiscover.xml.  It gave an error about
Parser Error Message: Could not load file or assembly 'Microsoft.Exchange.Security, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Line 41:         <add assembly="Microsoft.Exchange.Security, Version=15.0.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35" />

 The application logs were filled with ASP.NET 4.0.30319.0 Event code: 3008.

From what I found on a couple other blogs is that MS split a file into two and the installer doesn't properly create the second file in all directories as it should in later CU updates.

Copy the sharedwebconfig.config file from:
E:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy
To:
E:\Program Files\Microsoft\Exchange Server\V15\ClientAccess

I'll now post the full error messages for completeness.

From IE:

Server Error in '/Autodiscover' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Could not load file or assembly 'Microsoft.Exchange.Security, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error: 


Line 39:         <!--add assembly="Microsoft.Exchange.Common, Version=8.0.00207.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"/-->
Line 40:         <!--add assembly="Microsoft.Exchange.Data.Common, Version=8.0.00207.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"/-->
Line 41:         <add assembly="Microsoft.Exchange.Security, Version=15.0.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35" />
Line 42:       </assemblies>
Line 43:     </compilation>

Source File: E:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\Autodiscover\web.config    Line: 41 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Exchange.Security, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248



From Application Event Log:

 Event code: 3008
Event message: A configuration error has occurred.
Event time: 10/7/2015 4:12:01 PM
Event time (UTC): 10/7/2015 10:12:01 PM
Event ID: b89e6ff51088402180f450f7ad847cd1
Event sequence: 1
Event occurrence: 1
Event detail code: 0

Application information:
    Application domain: /LM/W3SVC/2/ROOT/Rpc-7-130887295216281384
    Trust level: Full
    Application Virtual Path: /Rpc
    Application Path: C:\Windows\System32\RpcProxy\
    Machine name: HOSTNAME

Process information:
    Process ID: 10544
    Process name: w3wp.exe
    Account name: NT AUTHORITY\SYSTEM

Exception information:
    Exception type: ConfigurationErrorsException
    Exception message: Could not load file or assembly 'Microsoft.Exchange.Security, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (C:\Windows\System32\RpcProxy\web.config line 37)
   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
   at System.Web.Configuration.AssemblyInfo.get_AssemblyInternal()
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
   at System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded)
   at System.Web.Compilation.BuildManager.ExecutePreAppStart()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)

Could not load file or assembly 'Microsoft.Exchange.Security, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)



Request information:
    Request URL: https://FQDN:444/rpc/rpcproxy.dll?
FQDN:6001
    Request path: /rpc/rpcproxy.dll
    User host address: 
    User:
    Is authenticated: False
    Authentication Type:
    Thread account name: NT AUTHORITY\SYSTEM

Thread information:
    Thread ID: 28
    Thread account name: NT AUTHORITY\SYSTEM
    Is impersonating: False
    Stack trace:    at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
   at System.Web.Configuration.AssemblyInfo.get_AssemblyInternal()
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
   at System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded)
   at System.Web.Compilation.BuildManager.ExecutePreAppStart()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)


Custom event details: