Filter Active Directory Records before Synchronisation

7 April 2011

You know Data Sync can synchronise user information data from your Active Directory into SharePoint and SQL etc. You can also filter what records to include by specifying a LDAP filter like this (&(objectClass=user)(memberOf=CN=SimegoDevelopers,CN=Users,DC=office,DC=simego,DC=com)) However this can get really complicated real fast if you actually want to do something a bit more complex. Therefore with Dynamic Column filtering it's much simpler, just override the BeginRow() method and apply your filtering with .NET Code instead. This will then be evaluated at runtime and only the rows that return true from this function will be included in the resulting data set. If you have a large AD it's still a good idea to partially filter the results with an LDAP Filter to maybe limit the OU then apply the .NET filter for the trickier parts.

public override bool BeginRow() { if ( this.MemberOf.Contains("Simego Developers") ) return true; return false; }

UPDATE: IncludeRow() is now BeginRow()

Dynamic Columns

| |