Usage
Where a signature needs to be applied on a specific attribute in Windows Azure Active Directory or Active Directory (eg Department, Country)
Use this as a work around for Dynamic Distribution Groups (Applies to CMS M365 only)
Create the Rule
a. Open your Crossware portal > Click on Rules > Create rule
b. Change the rule type to CUSTOM
c. Add the below code to the C# Editor
List < string > strList=new List < string > ();
strList.Add("continuous improvement");
strList.Add("corporate services");
strList.Add("finance");
strList.Add("management");
strList.Add("manufacturing & operations");
strList.Add("marketing");
strList.Add("operations");
strList.Add("purchasing");
strList.Add("sales & marketing");
strList.Add("accounts");
string strData;
strData="(!Department!)";
foreach(string strItem in strList) {
if (String.Equals(strData,strItem,StringComparison.OrdinalIgnoreCase)) {
return true;
}
}
return false;
d. Click on SAVE & CLOSE
Verify the Rule
a. Find a staff member who will trigger the rule
b. Click on SEND TEST EMAIL
c. Send on behalf of the relevant user
d. Verify the result

SUGGESTION: do the reverse test - ie send on behalf of someone not in the group - the rule should return "false"
Apply the Configuration
Open an existing Signature Configuration or Block
a. EDIT the Signature or Block
b. Click on the drop-down button under the Who is this signature for? section > Select Rule
c. Select Rule
d. Click the drop-down option under Select a rule > Select DepartmentSelection
e. Click on SAVE & CLOSE > Send Test Email to verify the Rule is working