How to set msExchRecipientTypeDetails Active Directory Attribute using VBScript.

When we move Mailbox from Exchange 2003 to Exchange 2007, it may be shown as Linked Mailbox.

This issue can occur if the associated external account was set on the user's Microsoft Exchange Server 2003 or Exchange 2000 Server mailbox.

To resolve the problem, modify the user account attribute msExchRecipientTypeDetails from a value of 2 to a value of 1 using ADSI Edit.

We can refer to the article mentioned below:

Or use the sample VBScript given below:

NOTE: Following programming examples is for illustration only, without warranty either expressed or implied,
including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose.
This sample code assumes that you are familiar with the programming language being demonstrated and the tools used
to create and debug procedures.

    1:  Dim obj
    2:  'ToDo: Modifiy the UserAlias, Domain, DomainExtn
    3:  Set obj = GetObject("LDAP://CN=UserAlias,CN=Users,DC=Domain,DC=DomainExtn")
    4:  obj.msExchRecipientTypeDetails = 1
    5:  obj.SetInfo()
    6:  Set obj = nothing
  
 Hope this helps! Enjoy