The source of my “HR” data does not always return consistent data.
A classic example of this is employeeEndDate, where the time value returned by the HR DB is often 00:00:00, but could be anything else!
The result of this is that if the user disablement rule says – use date/time of now – compare it to the employeeEndDate; if the end date has passed, then disable the account. Thus if the time value is inconsistent, you will get inconsistent user disablement’s occurring
So, to fix this in code, I did this – on the import from HR:
'CDR attributes required are: EndDate
'Code to define the employeeEndDate in the MV and Portal - needs to be in the correct format!
Dim dtFileTime As DateTime
If csentry("EndDate").IsPresent Then
dtFileTime = DateTime.Parse(csentry("EndDate").Value).Date
'Convert to the date/time string format that the Portal requires:
Dim employeeEndDate As String = dtFileTime.ToLocalTime.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'")
Dim arremployeeEndDate As String() = Split(employeeEndDate, "T")
employeeEndDate = arremployeeEndDate(0) & "T23:59:59.000"
mventry("employeeEndDate").Value = employeeEndDate
Now all employeeEndDate times are consistent “T23:59:59.000”