IIF with and conditions
Hi all As part of FIM 2010 RC1 demo I'm using IIF custom expression to calculate the DN of the user. This will be used so the user can be moved to the appropriate OU within the AD. The dn of the user is derived from a combination of 3 attributes that are imported form a CSV file (export for the HR system). All in all there are around 60 possible combinations. The demo will only show this for 2 OU's. I can still not tell if for the production environment a CS extension rule will be used or codeless provisioning but for now this part of the provisioning is to be done codelessly. The attributes that determine the dn structure are CP PA PSA Attached is the IIF statement I wrote (names have been changed intentionally) IIF(Eq(CP,"96"),"CN="+displayName+",OU=Users,OU=Ta,OU=Is,OU=Me,OU=Ng,DC=qn,DC=com",IIF(Eq(CP,"10" And PA,"5100" And PSA,"4000"),"CN="+displayName+",OU=Users,OU=Hk,OU=Ut,OU=Na,OU=Ng,DC=qn,DC=com",0)) Basically all users having attribute CP=96 are flowed into the main ou and all users having: Attribute CP=10 Attribute PA=5100 Attribute PSA=4000 Are flowed to a different ou. I tried playing around with the IIF syntax (and despite my research) could not arrive at the correct syntax and load the custom expression into the outbound syc rule Ideas greatly appreciated Thanksyarivb
January 17th, 2010 2:39pm

Hi yarivb, I'm afraid that you will have to concatenate IIF statements, since there is no builtin logical And function (there is only a bitwise And operator). Something like this, to give you an idea (remove the C-like comments): IIF( Eq(CP, "96"), "CN=" + displayName + ",OU=Users,OU=Ta,OU=Is,OU=Me,OU=Ng,DC=qn,DC=com", IIF( Eq(CP, "10"), IIF(Eq(PA, "5100"), IIF(Eq(PSA, "4000"), "CN=" + displayName + ",OU=Users,OU=Hk,OU=Ut,OU=Na,OU=Ng,DC=qn,DC=com", another_value_or_expression), // value if CP == 10,PA == 5100 and PSA != 4000 another_value_or_expression), // value if CP == 10 and PA != 5100 another_value_or_expression)) // value if CP != 10 Paolo Tedesco - http://cern.ch/idm
Free Windows Admin Tool Kit Click here and download it now
January 18th, 2010 1:25pm

HiI'll give it a try and let you knowThanksYarivyarivb
January 18th, 2010 3:45pm

I watned to know based on this if there was a guide or walk-through to accomplish this in a test environment. I am looking to do something like this but this is a few steps ahead of where i need to get started. Any help would be welcomed. Thanks,
Free Windows Admin Tool Kit Click here and download it now
August 30th, 2010 9:55pm

It may be helpful breaking down the IIF statement into smaller steps. For example Instead of 1 IIF statement that factors in several attibutes to determine something like a DN, break down the DN into smaller pieces into a multilevel workflow or outbound flow that includes strings, and custom expressions. Breaking down each piece of the DN at each OU= section made it easier to put together. String CN= displayName String ,OU= "attributeA" CustomExpression IIF(Eq(attributeA,"selectedvalue"),"piece of DN",",Differant piece of DN") String ,OU= "attributeB" String ,OU= "attributeC" String ,DC=X,DC=Y,DC=Z The above works only if value of attrubutes is equal to value of section of DN to be created minus the OU= part.
March 1st, 2011 8:12pm

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

Other recent topics Other recent topics