Posted on 2011-04-28
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

Question by:Trevor_M
    LVL 24

    Accepted Solution

    Is this a 2003 to 2010 migration in the same domain? If so, you don't need to do anything smart. As long as your 2003 servers are online, Outlook will automatically get redirected to the 2010 mailbox.

    Author Comment

    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


    Author Comment

    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


    Author Comment


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    In this video we show how to create a Distribution Group in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >>…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now