none
AccountExpires -> EmployeeEndDate Attribute Flow RRS feed

  • Question

  • Hello,

    I'm wondering if anyone has any resources on mapping AccountExpires (AD) -> EmployeeEndDate (FIM). I understand that this has to be done by rules extensions or advance attribute flows. Unfortionatly I do not have experience with either. Any help is appreciated.

    thanks,

    Josh

    Tuesday, April 28, 2015 12:52 AM

Answers

  • Thank you!

    I ended up using C# but your code helped a lot. For others who are looking for a solution, this is what I used.

    void IMASynchronization.MapAttributesForImport( string FlowRuleName, CSEntry csentry, MVEntry mventry)
            {
                switch (FlowRuleName){
                    case "getPwdLastSet":
                        if ((csentry["pwdLastSet"].IsPresent) && (csentry["pwdLastSet"].Value != "0"))
                        {
                            DateTime dtFileTimeUTC = DateTime.FromFileTimeUtc(csentry["pwdLastSet"].IntegerValue);
                            mventry["_pwdlastset"].Value = dtFileTimeUTC.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'");
                        }
                        break;
                    case "getAccountExpires":
                        if ((csentry["accountExpires"].IsPresent) && (csentry["accountExpires"].Value != "9223372036854775807")) {
                            DateTime dtFileTimeUTC = DateTime.FromFileTimeUtc(csentry["accountExpires"].IntegerValue);
                            mventry["employeeEndDate"].Value = dtFileTimeUTC.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'");
                        }
                        break;
                    
                }  
            }

    • Marked as answer by Jgonsalves Tuesday, April 28, 2015 6:45 PM
    Tuesday, April 28, 2015 6:45 PM

All replies

  • Hello,

    I've done something similar with the pwdLastSet attribute which has the same format in AD as AccountExpires
    (100-nanosec. since Jan. 1, 1601)

    So best ist to do an advanced flow from AD to MV in the correct format for FIM portal.

    Create a extension project for the advanced attribute flow you create first from AD to MV attribute:

    In the MapAttributeForImport Method paste a code like this:

                Case "updatePwdLastSet"
                    If (csentry("pwdLastSet").IsPresent) Then
                        If (csentry("pwdLastSet").Value <> "0") Then
                            Dim dtFileTimeUTC As DateTime = DateTime.FromFileTimeUtc(csentry("pwdLastSet").IntegerValue)
                            mventry("pwdLastSet").Value = dtFileTimeUTC.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'")
                        Else
                            mventry("pwdLastSet").Delete()
                        End If
                    End If

    Simple replace the attribute names in this example.

    /Peter


    Peter Stapf - ExpertCircle GmbH - My blog: JustIDM.wordpress.com

    Tuesday, April 28, 2015 7:56 AM
  • Thank you!

    I ended up using C# but your code helped a lot. For others who are looking for a solution, this is what I used.

    void IMASynchronization.MapAttributesForImport( string FlowRuleName, CSEntry csentry, MVEntry mventry)
            {
                switch (FlowRuleName){
                    case "getPwdLastSet":
                        if ((csentry["pwdLastSet"].IsPresent) && (csentry["pwdLastSet"].Value != "0"))
                        {
                            DateTime dtFileTimeUTC = DateTime.FromFileTimeUtc(csentry["pwdLastSet"].IntegerValue);
                            mventry["_pwdlastset"].Value = dtFileTimeUTC.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'");
                        }
                        break;
                    case "getAccountExpires":
                        if ((csentry["accountExpires"].IsPresent) && (csentry["accountExpires"].Value != "9223372036854775807")) {
                            DateTime dtFileTimeUTC = DateTime.FromFileTimeUtc(csentry["accountExpires"].IntegerValue);
                            mventry["employeeEndDate"].Value = dtFileTimeUTC.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'");
                        }
                        break;
                    
                }  
            }

    • Marked as answer by Jgonsalves Tuesday, April 28, 2015 6:45 PM
    Tuesday, April 28, 2015 6:45 PM