Employee End Date to accountexpires
Dear All,
I'm trying to flow the Employee End Date from FIM to the Active Directory attribute accountexpires (integer) without coding.
Does someone know how to do this?
Thanks in advance,
Yannick
February 18th, 2011 9:43am
Sorry - the only way I have been able to do this is via an advanced attribute flow. See this
post from Brad Turner which explains exactly how to do this ... sorry, but declarative rules won't cut it is my experience.Bob Bradley, www.unifysolutions.net (FIMBob?)
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2011 11:19am
If this can help, here is the code i will use to flow an Employee End Date from a HR database to AD and from AD to HR.
void IMASynchronization.MapAttributesForImport( string FlowRuleName, CSEntry csentry, MVEntry mventry)
{
//
// TODO: write your import attribute flow code
//
switch (FlowRuleName)
{
#region cd.user:accountExpires->mv.person:accountExpires
case "cd.user:accountExpires->mv.person:accountExpires":
if (csentry["accountExpires"].IntegerValue == 0 || csentry["accountExpires"].IntegerValue == 9223372036854775807)
{
// This is a special condition, do not contribute and delete any current value
mventry["accountExpires"].Delete();
}
else
{
DateTime dtFileTime = DateTime.FromFileTime(csentry["accountExpires"].IntegerValue);
mventry["accountExpires"].Value =
dtFileTime.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'");
}
break;
#endregion
default:
// TODO: remove the following statement and add your default script here
throw new EntryPointNotImplementedException();
}
}
void IMASynchronization.MapAttributesForExport (string FlowRuleName, MVEntry mventry, CSEntry csentry)
{
//
// TODO: write your export attribute flow code
//
switch (FlowRuleName)
{
#region cd.user:accountExpires<-mv.person:accountExpires
case "cd.user:accountExpires<-mv.person:accountExpires":
CultureInfo provider = CultureInfo.InvariantCulture;
if (mventry["accountExpires"].ToString() != "")
{
DateTime dtFileTime = DateTime.ParseExact(mventry["accountExpires"].Value, "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'", provider);
csentry["accountExpires"].IntegerValue = dtFileTime.ToFileTime();
}
break;
#endregion
throw new EntryPointNotImplementedException();
}
}
}
}
March 7th, 2011 9:23am