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.v
bs 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))
DCServer = "dcesifr01"
sUserLDAPName = QueryActiveDirectory(sUserName)
Set objUser = GetObject("LDAP://" & DCServer + "/" & sUserLDAPName)
Set objMailbox = objUser
If objMailbox.HomeMDB = "" Then
msgbox("You haven't been migrated")
msgbox("You've been migrated")
WSHShell.Run "wscript " & strFileName, , True
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")