Exporting accountExpires

Hi 

i'am using an extension rule for exporting the employeeEndDate  value to accountExpires. 

I have an issue ,when i delete the value in FIM, I can't manage the update of the accountExpires to set it to 0 

 if (mventry[MVConst.empEndDate].IsPresent)
                    {
                        CultureInfo provider = CultureInfo.InvariantCulture;

                        if (mventry[MVConst.empEndDate].Value != null)
                        {
                            DateTime dt = DateTime.ParseExact(mventry[MVConst.empEndDate].Value, "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'", provider);
                            csentry["accountExpires"].IntegerValue = dt.AddDays(1).ToFileTime();
                          
                        }
                        else
                        {
                            csentry["accountExpires"].IntegerValue = 0;
                        }
                       
					   
                    }
                    else {
                        csentry["accountExpires"].IntegerValue = 0;
                    }


Any idea 

June 26th, 2015 6:45am

You need to add an if statement where you say if mventey does not exist, set csentry to 0
Free Windows Admin Tool Kit Click here and download it now
June 26th, 2015 7:45am

I did a condition:  mventry[MVConst.empEndDate].IsPresent but it does not work

June 26th, 2015 8:10am

I am looking at your code.  Besides the fact that I don't know why you are using MVConst.emplEndDate instead of simply emplEndDate, it all looks good.

You really need to debug and see what is happening.  I would also try to set it to a string instead of integer.

csentry["accountExpires"].Value = "0";

or try this

csentry["accountExpires"].Value = "9223372036854775807";

Free Windows Admin Tool Kit Click here and download it now
June 26th, 2015 9:37am

When I run a preview I have a status not applied for my emplEndDate.


June 26th, 2015 9:42am

But you are looking what is going into the AccoutnExpires. So you need to see that part.

Also, try setting the values as I suggested in a string format.

Free Windows Admin Tool Kit Click here and download it now
June 26th, 2015 9:44am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics