Ensure Phone Numbers Have Country Code


Adaxes allows you to ensure that values for Active Directory object properties are entered in the correct format. The format can be defined either with the help of regular expressions or using constraints like must start with or must not contain.

To define format for Active Directory object properties, you need to use Property Patterns. Adaxes provides built-in Property Pattern User Pattern that is by default applied to all user accounts. In this tutorial, you will learn how to use the Property Pattern to ensure that phone numbers begin with a country code, like +44.

  1. Launch Adaxes Administration Console.

    Expand Adaxes service \ Configuration \ Property Patterns \ Builtin and select User Pattern.


  2. In the section located to the right, click Add and select Telephone Number in the drop-down list.

  3. Select the Must start with option and type a country code in the edit-box.



    Alternatively, you can use a regular expression to specify the format for telephone numbers. To do it, select Must match regexp and enter a regular expression, for example, ^([\(]{1}[0-9]{3}[\)]{1}[ ]{1}[0-9]{3}[\-]{1}[0-9]{4})$.

    Click the button located next to the edit box and enter the error message that will be shown if the validation fails.


    When done, click OK.

  4. Click Save changes.

Any changes made to built-in Property Patterns can be discarded. To do it, right-click a Property Pattern and click Restore to Initial State in the context menu.

Different Patterns for Different Users

By default, Property Pattern User Pattern is applied to scope All Objects.



This means that with its help you can define the same phone number format for all users in all domains managed by Adaxes. If you want to apply different settings for different Organizational Units or domains, you need to create a separate Property Pattern for each OU or domain.


  • Right-click Property Patterns, point to New and click Property Pattern.

  • Enter a name for the new Property Pattern and click Next.


  • On the Object Type page, select User and click Next.


  • On the Configuration page, configure options for a property and click Next.


  • To define the scope of activity for the Property Pattern, click Add.


  • In the Activity Scope dialog, select the following items:

    • Specific Domain - select to apply the Property Pattern to all users in a domain.
    • OU or Container - select to apply the Property Pattern to users in an Organizational Unit or container.
    • Group - select to apply the Property Pattern to members of a group.

      Assignments over group members are not applied during user creation.
    • Business Unit - select to apply the Property Pattern to members of a Business Unit. To select a Business Unit, open the Look in drop-down list and select the Business Units item.

    You can exclude specific Organizational Units, Business Units, groups, and domains from the activity scope of the Property Pattern. For example, if you've assigned the Property Pattern over the whole domain, but do not want it to apply to a specific Organizational Unit, you can exclude the Organizational Unit from the activity scope. To exclude an object, select the Exclude option in the Assignment Options dialog box.

    • Click the object you want to exclude.

    • In the Assignment Options dialog, select the Exclude option.


    • Click OK.
  • When done, click Finish.
Open tutorial filtering

Got questions?
Support Forum