HOWTO Programmatically Create a Recipient Policy?

HOWTO Programmatically Create a Recipient Policy?

Post by Haakon Jense » Thu, 18 Jan 2001 22:14:34


Which properies do i have to set on a msExchRecipientPolicy in order to get
the Recipent Update Service to use the policy when generating addresses?

I have made a application that sets the following properties on the new

Set obj = cntr.Create("msExchRecipientPolicy", "cn="PolicyName")
in container
/cn=Recipient Policies,cn=Org,cn=Microsoft

    - "purportedSearch"
    - "msExchPolicyOrder"
    - "msExchPolicyOptionList"
    - "systemFlags"
    - "gatewayProxy"
    - "msExchPurportedSearchUI"

When I go into Exchange System Mangager and open the policy I
programmatically created, and press MODIFY and FIND NOW, the users that
matches the filter specified in "purportedSearch" show up, so the LDAP-
filter is working.

The mail address specified in "gatewayProxy" is not applied to the user

What am I doing wrong? Do I have to manipulate objects other than
Any help or hints would be helpful!



1. Programmatically Creating Recipient Policies

I am having a problem when programmatically creating policies on certain
configurations.  I am running into a race condition where any users or
groups that are created after the policy, but before replication has
happened, do not get the policy applied to them by the RUS, even if I
select Rebuid on the RUS.  Users and groups created after Replication
are fine.

The policy is getting created on the parent domain DC and the users are
getting created in the child domain.

I have been banging my head off of this for days.  Any help would be
greatly appreciated.

Here is my configuration:

1 Domain Controller, is Global Catalog (call it ParentDC)

2 Domain Controllers
1 is Global Catalog, also First Exchange Server in Forest (call it
1 is not a Global Catalog, Second Exchange Server in Forest (call it

2. Multiple Aliases

3. Query: How To Create Recipient Policies Programmatically

4. Open ports firewall needed when connect from (Apple) Outlook via internet?

5. Programmatically add new domain to defualt recipient policy

6. Forwarding Mail to Public Folder

7. Programatically creating Recipient Policies

8. Deleting EX 5.5 from EX2K site

9. Unable to create Recipient Policy based on X500 DN

10. Programatically creating Recipient Policies

11. Recipient Policy creates a duplicate email in child domain

12. Event ID: 1 InternetProxy when creating SMTP in default recipient policy

13. error creating new recipient policy