What is the function "Ispresent" for? RRS feed

  • Question

  • All, Can someone explain what does the function "Ispresent" returns?

    For example: I have 2 types of user.

    a)For one type, I will set/unset a "Admin" string attribute.

    b)For the other type, this attribute will not be touched any time.

    If I have MV extension code (mventry["Admin"].IsPresent) , what will it return for second type of users any time? For the first type of users, once the attribute is set, will it always return true?


    Saturday, May 11, 2013 11:44 PM

All replies

  • The IsPresent function checks if the attribute is there. If you never set the attribute in the metaverse for your second type of object, it should always return false. Otherwise, if you set a value on it, it will return true.



    [Edit: More details here: http://social.technet.microsoft.com/Forums/en-US/identitylifecyclemanager/thread/a1a8f5c6-ddf8-442c-863d-cab37b94759f ]
    • Edited by SamiVV Tuesday, May 14, 2013 8:51 PM added a reference link
    • Proposed as answer by Chris Clayton - STLCC Wednesday, May 15, 2013 9:24 PM
    Tuesday, May 14, 2013 8:43 PM
  • It can be used on mventry("attribute") as well as csentry("attribute).  The most common usage for .IsPresent is to ensure that you don't reference a null and cause an exception to be thrown.  Like when building a display name with last name, first name and middle initial...and you don't know if there is a middle name to grab the initial from or not.


    Wednesday, May 15, 2013 9:23 PM