Search Type:
Search for:

Language:

Product:
Category:
No categories for selected product

GAL lookup on Good Mobile devices does not work for Exchange mailboxes

Article ID: 1664 
Last Review: Feb,9 2009
Author: Vitaly Filatov
Last updated by: Vitaly Filatov APPLIES TO:
  • Parallels Operations Automation 2.6

Symptoms

In POA versions 2.6 and 2.6 update 1 mailboxes with Good Link support could not use "GAL Lookup" feature.

Cause

GAL Lookup feature uses value from msExchQueryBaseDn attribute and expects that it stores distinguished name (DN) of organization unit (OU) of the organization. Since POA version 2.6 until version 2.6 update 2 this attribute stores the DN of organization's address list.

Resolution


  1. Log on to MPS server (MPS01).
  2. Copy the following text and paste to the new file fixMsQueryBaseDn.vbs.

    Option Explicit
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    Dim logFile
    Dim logFilename
    logFilename = WScript.ScriptFullName & ".log"
    Set logFile = fso.CreateTextFile( logFilename, True, True )

    Dim argsObj
    Set argsObj = WScript.Arguments
    If argsObj.Length <> 1 Then
     Usage
    ElseIf LCase(argsObj(0)) = "all" Then
     ProcessItems GetHostingOuDn(), 0
    Else
     Dim userObj
     logFile.WriteLine "Processing " & argsObj(0)
     Set userObj = GetObject(argsObj(0))
     ProcessUser userObj, GetObject(userObj.parent), 0
    End If

    WScript.Echo "Executed successfully. See log file " & logFilename & "."
    WScript.Quit(0)

    Sub Usage()
     Dim stdErr
     Set stdErr = WScript.StdErr
     stdErr.WriteLine "Usage:"
     stdErr.WriteLine "1. For fixing all mailboxes in Hosting OU and under it:"
     stdErr.WriteLine " cscript.exe /nologo fixMsQueryBaseDn.vbs ALL"
     stdErr.WriteLine "2. For fixing only one mailbox:"
     stdErr.WriteLine " cscript.exe /nologo fixMsQueryBaseDn.vbs LDAP://<LDAP path of mailbox>"
     stdErr.WriteLine "example: cscript.exe /nologo fixMsQueryBaseDn.vbs ""LDAP://cn=john,ou=neverhood inc,ou=provider,ou=Hosting,dc=he,dc=local"""
     WScript.Quit(1)
    End Sub

    Function GetHostingOuDn()
     Dim ObjSrv
     Set ObjSrv = GetObject("LDAP://RootDse")

     Dim dcSuffix
     dcSuffix = ObjSrv.Get("defaultNamingContext")
     Dim PemConfigObj
     Set PemConfigObj = GetObject("LDAP://CN=PEM Configuration,CN=System," & dcSuffix)

     Dim xmlObj
     Set xmlObj = CreateObject("Microsoft.XMLDOM")
     xmlObj.validateOnParse = True
     xmlObj.async = False
     xmlObj.loadXML(PemConfigObj.Get("adminDescription"))

     Dim hostingOuPath
     hostingOuPath = xmlObj.SelectSingleNode("//config/hostingOUName").text

     GetHostingOuDn = "OU="& hostingOuPath &"," & dcSuffix
    End Function

    Sub ProcessItems( byval name, byval level )
     Dim containerObj
     Set containerObj = GetObject("LDAP://"& name )
     containerObj.Filter = Array("user", "organizationalUnit")
     Dim objUser
     For Each objUser In containerObj
      Dim x
      For each x in objUser.objectClass
       If x = "user" Then
        ProcessUser objUser, containerObj, level
        Exit For
       ElseIf x = "organizationalUnit" Then
        ProcessOU objUser, level
        Exit For
       End If
      Next
     Next
    End Sub

    Function GetADPropertyAsString(obj, propName)
     Dim lastErr
     Dim propValue
     On Error Resume Next
     propValue = obj.Get(propName)
     lastErr = Err.Number
     On Error Goto 0
     ' &h8000500D  - PROPERTY NOT SET
     If (lastErr <> 0) And (lastErr <> &h8000500D) Then Err.Raise lastErr
     GetADPropertyAsString = "" & propValue
    End Function

    Sub ProcessUser( byval objUser, byval parentObj, byval level )
     logFile.Write Replace(Space(level), " ", ".") & " user "& objUser.cn & " ... "
     If "" = GetADPropertyAsString(objUser, "homeMDB") Then
      logFile.WriteLine " not a mailbox - skipping"
     ElseIf LCase(GetADPropertyAsString(objUser, "msExchQueryBaseDn")) <> LCase(parentObj.distinguishedName) Then
      objUser.Put "msExchQueryBaseDn", parentObj.distinguishedName
      objUser.SetInfo
      logFile.WriteLine " ""msExchQueryBaseDn"" replaced"
     Else
      logFile.WriteLine " mailbox is OK"
     End If
    End Sub

    Sub ProcessOU( byval objOu, byval level )
     logFile.WriteLine Replace(Space(level), " ", ".") & " Processing "& objOu.distinguishedName
     ProcessItems objOu.distinguishedName, level+1
    End Sub
  3. Save the file fixMsQueryBaseDn.vbs and execute it from the command line (Programs > Accessories > Command Prompt) to fix mailboxes:
    for fixing all hosted mailboxes:

    C:\>cscript.exe /nologo fixMsQueryBaseDn.vbs ALL

    for fixing individual mailbox:

    C:\>cscript.exe /nologo fixMsQueryBaseDn.vbs LDAP://<LDAP path of mailbox>
  4. Check the file fixMsQueryBaseDn.vbs.log for execution results.
Keywords: gal lookup


Subscription for changes to this article Subscription for changes to this article

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
* - required fields
 
 
 
 
 
 
For Home
For Business
For Hosters
For SaaS
For Developers
 
Desktop Virtualization
- Parallels Desktop Switch to Mac Edition
- Parallels Desktop for Mac
- Parallels Desktop 4 for Windows & Linux
- Parallels Workstation Extreme
- Parallels Solution for Windows 7
Server Virtualization
- Parallels Server for Mac
- Parallels Server 4 Bare Metal
- Parallels Virtuozzo Containers
Automation
- Parallels Operations Automation
- Parallels Business Automation
- Parallels Virtual Automation
- Parallels Plesk Panel Suite
More Products