AADConnect 1.1 SyncScheduler Issue: DateTime Error and Scheduler not working


I recently installed Azure AD Connect 1.1 (Build 1.1.105.0) in my demolab.
I installed on a fresh Windows Server 2012 R2 with latest hotfixes and done the following:

  • Install AADC in Custom Setting Mode
  • Done all settings (which are not relevant to that issue)
  • Disabled direct start of Scheduler to modify sync rules
  • Re-Run AADC Wizard and activated the now internal Scheduler

But when checking SyncCycle within the Sync Service Manager I cloud not see any syncs.

Checking the Scheduler with “Get-ADSyncScheduler” PowerShell Cmdlet gives following output:

AllowedSyncCycleInterval            : 00:30:00
CurrentlyEffectiveSyncCycleInterval : 00:30:00
CustomizedSyncCycleInterval         :
NextSyncCyclePolicyType             : Initial
NextSyncCycleStartTimeInUTC         : 01.01.0001 00:00:00
PurgeRunHistoryInterval             : 7.00:00:00
SyncCycleEnabled                    : False
MaintenanceEnabled                  : True
StagingModeEnabled                  : False

Wired DateTime of NextRunCycle, right ?

I tried to enable Scheduler with Set-ADSyncScheduler PowerShell failed and after that I got the following error on all further cmdlet’s:

Get-ADSyncScheduler : System.Runtime.Serialization.SerializationException: DateTime values that are greater than
DateTime.MaxValue or smaller than DateTime.MinValue when converted to UTC cannot be serialized to JSON. --->
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value
--- End of inner exception stack trace ---
at System.Runtime.Serialization.Json.JsonWriterDelegator.WriteDateTimeInDefaultFormat(DateTime value)
at System.Runtime.Serialization.Json.JsonWriterDelegator.WriteDateTime(DateTime value)
at System.Runtime.Serialization.XmlWriterDelegator.WriteDateTime(DateTime value, XmlDictionaryString name,
XmlDictionaryString ns)
at WriteSchedulerSettingsToJson(XmlWriterDelegator , Object , XmlObjectSerializerWriteContextComplexJson ,
ClassDataContract , XmlDictionaryString[] )
at System.Runtime.Serialization.Json.JsonClassDataContract.WriteJsonValueCore(XmlWriterDelegator jsonWriter, Object
obj, XmlObjectSerializerWriteContextComplexJson context, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.Json.JsonDataContract.WriteJsonValue(XmlWriterDelegator jsonWriter, Object obj,
XmlObjectSerializerWriteContextComplexJson context, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalWriteObjectContent(XmlWriterDelegator
writer, Object graph)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalWriteObject(XmlWriterDelegator writer,
Object graph)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object
graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.WriteObject(XmlDictionaryWriter writer, Object
graph)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.WriteObject(Stream stream, Object graph)
at Microsoft.IdentityManagement.PowerShell.ObjectModel.SchedulerSettings.Serialize()
at SchedulerUtils.GetCurrentSchedulerSettings(_ConfigAttrNode* pcanList, UInt32 ccanItems, Char**
syncSettingsSerialized, Char** errorString)
At line:1 char:1
+ Get-ADSyncScheduler
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : WriteError: (Microsoft.Ident...ADSyncScheduler:GetADSyncScheduler) [Get-ADSyncScheduler]
, PSInvalidOperationException
+ FullyQualifiedErrorId : System.Runtime.Serialization.SerializationException: DateTime values that are greater th
an DateTime.MaxValue or smaller than DateTime.MinValue when converted to UTC cannot be serialized to JSON. ---> Sy
stem.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value
--- End of inner exception stack trace ---
at System.Runtime.Serialization.Json.JsonWriterDelegator.WriteDateTimeInDefaultFormat(DateTime value)
at System.Runtime.Serialization.Json.JsonWriterDelegator.WriteDateTime(DateTime value)
at System.Runtime.Serialization.XmlWriterDelegator.WriteDateTime(DateTime value, XmlDictionaryString name, XmlD
ictionaryString ns)
at WriteSchedulerSettingsToJson(XmlWriterDelegator , Object , XmlObjectSerializerWriteContextComplexJson , Clas
sDataContract , XmlDictionaryString[] )
at System.Runtime.Serialization.Json.JsonClassDataContract.WriteJsonValueCore(XmlWriterDelegator jsonWriter, Ob
ject obj, XmlObjectSerializerWriteContextComplexJson context, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.Json.JsonDataContract.WriteJsonValue(XmlWriterDelegator jsonWriter, Object obj,
XmlObjectSerializerWriteContextComplexJson context, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalWriteObjectContent(XmlWriterDelegator w
riter, Object graph)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalWriteObject(XmlWriterDelegator writer,
Object graph)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Obje
ct graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.WriteObject(XmlDictionaryWriter writer, Object
graph)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.WriteObject(Stream stream, Object graph)
at Microsoft.IdentityManagement.PowerShell.ObjectModel.SchedulerSettings.Serialize()
at SchedulerUtils.GetCurrentSchedulerSettings(_ConfigAttrNode* pcanList, UInt32 ccanItems, Char** syncSettingsS
erialized, Char** errorString),Microsoft.IdentityManagement.PowerShell.Cmdlet.GetADSyncScheduler

Talking to PG is turns out that this is an issue when installing AADC 1.1 with different regional setting (mainly for date setting) than US. So switched regional setting on my server to English (US) so date is formatted MM/dd/yyyy and re-run the AADC wizard.

Scheduler start working now, I’m able to change all settings with PowerShell and also can start SyncCycles manually with Start-ADSyncSyncCycle.

However output from Get-ADSyncScheduler is still showing the wired DateTime format, but all things are working.
Since I put that issue as a feedback into PG we can expect a hotfix in that in the near future.

So maybe swtich the regional settings to EN-US when installing AADC 1.1 until this issue is fixed.

 

 

 

Advertisements

About Peter Stapf
Senior Consultant Infrastructure Services (Main focus: Identity Management) MVP Directory Services

One Response to AADConnect 1.1 SyncScheduler Issue: DateTime Error and Scheduler not working

  1. Peter Stapf says:

    Uhh, thats fast, there is already an update of AADC 1.1 which fixes this error some other.
    See: https://azure.microsoft.com/en-us/documentation/articles/active-directory-aadconnect-version-history/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: