We help IT Professionals succeed at work.


Trevor_M asked
Medium Priority
Last Modified: 2012-05-11
Hello Expert Community

I am faced with a difficulty that is to make sure that Outlook users previously on EX2003 transparently open their session under EX2010 only if their account already exists if once migrated.
At the moment; I am standing against the idea of a script that once launched by a user from \\Inp027\screen$\has_mbx.vbs will check against existing migrated users to Exchange 2010 before the implementation of a new outlook profile.  Which relies on the fact that users would have previously backed up their configurations otherwise they would lose their previous configuration in the event a user did not take the time to make a backup.  
I believe that it may be possible to make routine that preserves existing outlook clients configurations unmodified or unaltered expect for updating a profile towards connecting with the new exchange server 2010 if already migrated.  Devoid of the need for the users to backup their environments prior to a scheduled migration; nor expecting them to launch a script before opening outlook.
As far as I understand; the migration team came up with a script (presently attached) that would check the user account against those already migrated; if the response returns positive; the script would then create a new profile under the new exchange server; yet users would then have to import their backup; if any existed in the first place.
Any advice would be greatly welcomed;
Dim ArgObj, WshShell, objEnv, objUser, objMailbox 
Dim sUserLDAPName, DCServer, strFileName

strFileName = "\\inp027\screen$\outlook.vbs"

' Get the Arguments object
Set ArgObj = WScript.Arguments

If ArgObj.Count < 1 Then
   Set WshShell = WScript.CreateObject("WScript.Shell")
   Set objEnv = WshShell.Environment("PROCESS")
   sUserName = objEnv("USERNAME")
   sUserName = UCase(ArgObj(0))
End If

DCServer = "dcesifr01"
sUserLDAPName = QueryActiveDirectory(sUserName)

Set objUser = GetObject("LDAP://" & DCServer + "/" & sUserLDAPName)
Set objMailbox = objUser

If objMailbox.HomeMDB = "" Then
	msgbox("You haven't been migrated")
	'WScript.Quit 1
	msgbox("You've been migrated")
	'WScript.Quit 0
	WSHShell.Run "wscript " & strFileName, , True
End If

Public Function QueryActiveDirectory(sUserName)
Dim oAD, oGlobalCatalog, oRecordSet, oConnection, strADsPath, strQuery, strUPN
    set oRecordSet = CreateObject("ADODB.Recordset")
    set oConnection = CreateObject("ADODB.Connection")

    'Determine the global catalog path
	Set oAD = GetObject("GC:")
    For Each oGlobalCatalog In oAD
        strADsPath = oGlobalCatalog.AdsPath
    'Initialize the ADO object
    oConnection.Provider = "ADsDSOObject"
    'The ADSI OLE-DB provider
    oConnection.Open "ADs Provider"
    'Create the search string
    strQuery = "<" & strADsPath & ">;(&(objectClass=user)(objectCategory=person)(samaccountName=" & sUserName & "));userPrincipalName,cn,distinguishedName;subtree"  
        'Execute the query
    Set oRecordSet = oConnection.Execute(strQuery)
    If oRecordSet.EOF And oRecordSet.BOF Then    
       'An empty recordset was returned
        QueryActiveDirectory = "Not Found"
    Else    'Records were found; loop through them
        While Not oRecordSet.EOF
            QueryActiveDirectory = oRecordSet.Fields("distinguishedName")
    End If
End Function

Open in new window

Watch Question

Office 365 & Exchange Architect
Unlock this solution and get a sample of our free trial.
(No credit card required)


Hi Rajith

Thank you
does it mean that the mailbox previously existing on 2003 needs to be taken off line before EX2003 may redirect Outook towards EX2010... On the contrary if both exchange 2003/2010 presently have on each server a user mailbox apartening to the same owner; the redirection may not take place which might create a conflicting situation at the first start of OUTLOOK post migrating to EX2010...

Please assist further

Kind regards



sorry there is not bridge between both exchange 2003/2010 which makes the whole process less practicale. however some clients are running outlook 2003 which could easilmy be upgraded to 2007 so that the Autodiscover service automatically configures user profile settings for clients running Microsoft Office Outlook 2007 on exchange 2010

any thoughts?

Kind regards



Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.